flash on 2011-7-20

by kappa-lab
♥0 | Line 17 | Modified 2011-07-20 00:43:17 | MIT License
play

ActionScript3 source code

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

package {
    import flash.text.TextField;
    import flash.display.Sprite;
    import flash.events.*;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            this.graphics.beginFill(0);
            this.graphics.drawRect(0,0,400,100);
            
            var tf:TextField = addChild(new TextField()) as TextField
            tf.text = "test";
            tf.y = 130;
            stage.doubleClickEnabled = true;
            stage.addEventListener(MouseEvent.CLICK,function():void{tf.text = "CLICK"});
            stage.addEventListener(MouseEvent.DOUBLE_CLICK,function():void{tf.text = "DOUBLE_CLICK"});
            
        }
    }
}