ステージに配置された 2 つの要素の位置を入れ替える JSFL

September 09, 2009category: Flash JSFL 

ステージに配置された 2 つの要素の位置を入れ替える JSFL を書いた。

var selection = fl.getDocumentDOM().selection;
if (selection.length === 2) {
  var temp = {};
  temp.x = selection[0].x;
  temp.y = selection[0].y;
  selection[0].x = selection[1].x;
  selection[0].y = selection[1].y;
  selection[1].x = temp.x;
  selection[1].y = temp.y;
}

同一レイヤ上且つ、同一サイズの画像同士の位置替えが楽になると思う。

comments (0)

comments