I'm asking this question just because curiousity. In as3, while using Event.ADDED_TO_STAGE listener, it's called 2 times automatically. I've tested this with trace. I've checked if I add the movieclip 2 times but there is no such thing. I only add the movieclip once.
If I remove this listener on the begining of the listener's function, this problem doesn't occur. To give an example which traces only once:
addEventListener(Event.ADDED_TO_STAGE,added);
public function added(e:Event){
removeEventListener(Event.ADDED_TO_STAGE,added);
trace("MovieClip is added");
}
And this is the example which traces twice: addEventListener(Event.ADDED_TO_STAGE,added);
public function added(e:Event){
trace("MovieClip is added");
}
If anyone tells the reason It'd be really appreciated.
Thank you
-Ozan
eventPhase
andtarget
of the evente
during each call? – Cameron