开发者

Flex: detect end of move function

开发者 https://www.devze.com 2023-02-09 14:12 出处:网络
I need to create an animation and provide some results of the move function at the END of the animation. However, i 开发者_StackOverflow社区am not able to control the output till the move function is

I need to create an animation and provide some results of the move function at the END of the animation. However, i 开发者_StackOverflow社区am not able to control the output till the move function is completed

I tried the isPlaying- that doesn't seem to detect that the animation is completed... so continues to output resukts before the animation is complete

sample code I tried

private function mvbut():void{

    var mv:Move= new Move;
    mv.xFrom=Math.random()*300;
    mv.yFrom=Math.random()*200;
    mv.xBy=200;mv.yBy=300;  
    mv.duration=1000;

    mv.target=button1;  
    mv.play();

    AddinDataGrid(i); //function to output final x,y values
    i++;


Add an event listener

var move:Move = new Move()
                    move.addEventListener(EffectEvent.EFFECT_END, function ...);
0

精彩评论

暂无评论...
验证码 换一张
取 消