flash on 2011-7-15

by kappa-lab
♥0 | Line 18 | Modified 2011-07-15 01:38:11 | 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/j5ng
 */

package {
    import flash.events.*;
    import flash.utils.Timer;
    import flash.text.TextField;
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var tf:TextField = addChild(new TextField()) as TextField;
            tf.text = "aaa";
            var timer:Timer = new Timer(1000,10);
            timer.addEventListener(TimerEvent.TIMER,onTimer);
            function onTimer(e:TimerEvent):void{
                tf.text = timer.currentCount.toString();
            }

            timer.start()
            
        }
    }
}