Reputation: 1541
The name of my DocumentClass is Main. So, what's the difference between :
var myClass:Main = new Main();
var mcInLibrary:MovieClip ;
/////////////////////////////////////////
myClass.addChild(mcInLibrary) ;
//////// - VS - /////////////////////
myClass.stage.addChild(mcInLibrary) ;
/////////////////////////////////////////
Upvotes: 1
Views: 76
Reputation: 5740
With
myClass.addChild(mcInLibrary) ;
you're adding the mcInLibrary to the DisplayList of myClass.
With
myClass.stage.addChild(mcInLibrary) ;
you're adding it to the stage in which myClass is instantiated. Every instance which is derived from DisplayObject has the property stage, which refers to the stage instance to which it is added (essentially the root of the Display list).
Upvotes: 1