topical media & game development

talk show tell print

animation-ch19-Timer1.ax

animation-ch19-Timer1.ax [swf] [flash] flex


  package {
   import flash.display.Sprite;
   import flash.utils.Timer;
   import flash.events.TimerEvent;
  
   public class @ax-animation-ch19-Timer1 extends Sprite
   {
    private var timer:Timer;
    
    public function @ax-animation-ch19-Timer1()
    {
     init();
    }
  

init(s)


    private function init():void
    {
     timer = new Timer(30);
     timer.addEventListener(TimerEvent.TIMER, onTimer);
     timer.start();
    }
   

timer(s)


    private function onTimer(timer:TimerEvent):void
    {
     trace("timer!");
    }
   }
  }
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.