Guest User

Untitled

a guest
Jun 16th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package;
  2. import flash.display.Sprite;
  3. import flash.events.TimerEvent;
  4. import flash.Lib;
  5. import flash.utils.Timer;
  6. /**
  7.  * ...
  8.  * @author Jan J. Flanders
  9.  */
  10. class Main extends Sprite
  11. {
  12. var t:Timer;
  13. var i:Int;
  14.     public function new()
  15.     {
  16.         super();
  17.         i=0;
  18.         t = new Timer(500);
  19.         t.addEventListener(TimerEvent.TIMER, onTimer);
  20.         t.start();
  21.     }
  22.     function onTimer (event:TimerEvent):Void
  23.     {
  24.         i++;
  25.         trace(i);
  26.     }
  27.     public static function main()
  28.     {
  29.         Lib.current.addChild(new Main());
  30.     }
  31. }
Add Comment
Please, Sign In to add comment