How to do something after effect animation ends in Flex?
Posted
by Chobicus
on Stack Overflow
See other posts from Stack Overflow
or by Chobicus
Published on 2010-03-25T15:19:34Z
Indexed on
2010/03/25
15:23 UTC
Read the original article
Hit count: 147
I'm a beginner in Flex so there must be more elegant way of doing this.
//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();
}
Method moveText is called in a loop so I guess that labels don't get "garbage collected".
What I want to do is to remove Labels created in moveText method after play animation ends.
Another way of doing this is maybe creating some kind of "pool" of labels which I would use to move arround text. I don't know how would I return labels in to "pool".
The question is how to do something after effect animation ends?
© Stack Overflow or respective owner