Created
August 17, 2015 11:31
-
-
Save mizutanikirin/b5b21944ae5374da13eb to your computer and use it in GitHub Desktop.
ADDED_TO_STAGE
From http://www.inazumatv.com/contents/archives/177
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package { | |
import flash.display.MovieClip; | |
import flash.events.Event; | |
public class SomeClass extends MovieClip { | |
public function SomeClass(){ | |
super(); | |
if (stage) init(null); | |
else addEventListener(Event.ADDED_TO_STAGE, init); | |
} | |
private function init(evt:Event) : void { | |
if (evt != null) | |
removeEventListener(Event.ADDED_TO_STAGE, init); | |
trace (stage.stageWidth); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment