Hello, Flash World!

by cx20
♥0 | Line 21 | Modified 2014-02-02 04:06:11 | MIT License
play

ActionScript3 source code

/**
 * Copyright cx20 ( http://wonderfl.net/user/cx20 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/7fcZ
 */

package 
{
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.text.*;
    
    public class Main extends Sprite 
    {
        public function Main():void 
        {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }
        
        private function init(e:Event = null):void 
        {
            removeEventListener(Event.ADDED_TO_STAGE, init);

            var textField:TextField = new TextField();
            textField.text = "Hello, Flash World!";
            this.addChild(textField);
        }
    }
}