2014-08-30 43 views
0

我的項目有靠右側面板:如何將轉移應用到左對齊元素?

<s:BorderContainer id="panelRight" right="0" top="60" bottom="30" width="333"> 

當我執行該代碼

move.target = panelRight; 
move.xBy = +panelRight.width; 
move.play(); 

什麼也沒有發生:這是因爲panelRighti saligned到吧!

我該如何解決這個問題?

回答

0

您可以使用Animate類代替Move,並且不會爲x添加效果,但right屬性不會添加效果。它會是這樣的:

var moveEffect:Animate = new Animate(); 
moveEffect.target = panelRight; 
moveEffect.motionPaths = Vector.<MotionPath>([new SimpleMotionPath("right", null, null, -panelRight.width)]); 
moveEffect.play(); 

效果看起來是一樣的。

Animate class

相關問題