ADDED event in document class after removed from Stage
Hi All,
I am currently play with the document class (the class acts as main) constructor for a SWF file.
package {
import flash.display.*;
import flash.events.*;
public class TestSymbol extends MovieClip
{
public function TestSymbol()
{
this.addEventListener(Event.ADDED, function(event:Event) { trace(event.eventPhase, event.target, event.currentTarget, "added triggered"); });
trace("parent", this.parent);
this.stage.removeChild(this);
trace("stage", this.stage);
}
}
}
In frame script 1, i put
trace("1");
trace("parent", this.parent);
After i run TestSymbol.swf and i got
parent [object Stage]
stage null
2 [object TestSymbol] [object TestSymbol] added triggered
1
parent null
I wonder where is this ADDED event coming from? If the document class is added to some other objects, why its parent is null after the event?
Thanks in advance
Sam