Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package;
- import flash.display.Sprite;
- import flash.events.TimerEvent;
- import flash.Lib;
- import flash.utils.Timer;
- /**
- * ...
- * @author Jan J. Flanders
- */
- class Main extends Sprite
- {
- var t:Timer;
- var i:Int;
- public function new()
- {
- super();
- i=0;
- t = new Timer(500);
- t.addEventListener(TimerEvent.TIMER, onTimer);
- t.start();
- }
- function onTimer (event:TimerEvent):Void
- {
- i++;
- trace(i);
- }
- public static function main()
- {
- Lib.current.addChild(new Main());
- }
- }
Add Comment
Please, Sign In to add comment