Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import flash.display.Sprite;
- import flash.events.TimerEvent;
- import flash.utils.Timer;
- import flash.Lib;
- class Main extends Sprite
- {
- var t:Timer;
- var i:Int;
- public static function main()
- {
- #if flash
- new Main();
- #else
- Lib.create(function(){new Main();},800,600,1,0xccccff,(1*Lib.HARDWARE) | Lib.RESIZABLE);
- #end
- }
- public function new()
- {
- super();
- Lib.current.addChild(this);
- i=0;
- t = new Timer(500);
- t.addEventListener(TimerEvent.TIMER, onTimer);
- t.start();
- }
- function onTimer (event:TimerEvent):Void
- {
- i++;
- trace(i);
- }
- }
Add Comment
Please, Sign In to add comment