/ Published in: ActionScript 3
Expand |
Embed | Plain Text
package { import flash.events.Event; public class MyClass extends MovieClip { public function MyClass() { super(); addEventListener(Event.ADDED_TO_STAGE,added); // stage is null; try trace(stage.stagewidth); ==> null object } public function added(evt:Event):void{ removeEventListener(Event.ADDED_TO_STAGE,added); // stage is not null; try trace(stage.stagewidth); ==> somevalue } } }
You need to login to post a comment.
