Thursday, September 6, 2018

AS3: Basic Timer example

ad300
Advertisement

AS3: Basic Timer example 


Flash's Timer Class requires two parameters. The first is the delay (in milliseconds), the second is the amount of times you want the delay to fire.

  1. var timer:Timer = new Timer(1000, 2);
  2. timer.addEventListener(TimerEvent.TIMER, blah);
  3. timer.start();
  4. function blah(e:TimerEvent):void{
  5. trace("Times Fired: " + e.currentTarget.currentCount);
  6. trace("Time Delayed: " + e.currentTarget.delay);
  7. }
Share This
Previous Post
Next Post

Pellentesque vitae lectus in mauris sollicitudin ornare sit amet eget ligula. Donec pharetra, arcu eu consectetur semper, est nulla sodales risus, vel efficitur orci justo quis tellus. Phasellus sit amet est pharetra

0 comments:

Ad Section2

Sponsor

Ad Section