代码之家  ›  专栏  ›  技术社区  ›  Chobicus

如何在flex中结束效果动画?

  •  0
  • Chobicus  · 技术社区  · 16 年前

    我是flex的初学者,所以一定有更优雅的方法。

    //move effect
    private var m:Move = new Move(); 
    
    //this function creates labels with some text and starts move effect on them
    public function moveText(i:int):void {
        var myLabel:Label = new Label();
        myLabel.text = "some text"; 
        m.target = myLabel;
        ... 
        m.play();               
    }
    

    moveText方法是在循环中调用的,所以我猜标签不会被“垃圾回收”。

    我要做的是在播放动画结束后删除在moveText方法中创建的标签。

    另一种方法是创建一个标签池,我可以用它来移动傲慢的文本。我不知道怎么把标签放回“泳池”里。

    问题是在效果动画结束后怎么做?

    2 回复  |  直到 16 年前
        1
  •  2
  •   Jason    16 年前

    你可以听 EffectEnd 事件。

    退房 here

        2
  •  0
  •   Robusto    16 年前

    看看 效果 效果类中的事件。你可以在里面放一个处理程序来收集垃圾。

    推荐文章