2011-10-23 30 views
0

這裏的交易:查看過渡結束

我有一個形象,我的手機應用程序的homeview一個按鈕。

我通過按下按鈕將動畫應用於圖像。這很好。

問題:

我要添加動畫完成後推到下圖的圖過渡。

CODE:

AS:

protected function nextView() 
    { 
    navigator.pushView(View2); 
    } 

MXML:

<s:Button id="Button" click="anim.play()"/> //anim.play() is in 
    //the declarations tag and is working as expected. 

    <s:Image id="img" source="@Embed('assets/image.png')"/> 

我已經試過:

-Adding nextView()的點擊實現方法具動畫後d叫

- 使用effectEnd="nextView()"在按鈕屬性

感謝您的幫助和洞察力,您可以提供。

回答

0

effectEnd在似乎爲我工作:

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
       xmlns:s="library://ns.adobe.com/flex/spark"> 
    <fx:Declarations> 
     <s:Move id="myEffect" xBy="100" target="{btn}" effectEnd="navigator.pushView(NextView)" /> 
    </fx:Declarations> 

    <s:ViewNavigator id="navigator" width="100%" height="100%"/> 

    <s:Button id="btn" label="play" click="myEffect.play()" /> 

</s:Application>