0 Replies - 1047 Views - Last Post: 13 June 2008 - 09:47 PM

#1 RodgerB  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 66
  • View blog
  • Posts: 2,284
  • Joined: 21-September 07

Creating a Timer in 3.0

Posted 13 June 2008 - 09:47 PM

Description: 1) Copy and paste the snippet into the action you need (e.g. Frame). 2) Read the comments. :)Demonstrates how to create a timer in ActionScript 3.0. Thanks to this article: http://blogs.adobe.c...s_in_actio.html
// Variable to determine how fast the timer
// will run
var intTmrSpeed:int = 1000;

// declare the timer
var tmrLol:Timer = new Timer(intTmrSpeed);

// tell the timer to use tmrLol_Tick
// when the timer ticks
tmrLol.addEventListener(TimerEvent.TIMER, tmrLol_Tick);

// start the timer
tmrLol.start();

// function to be called every time
// the timer ticks.
function tmrLol_Tick(event:TimerEvent):void
{
    // do stuff here.
}


Is This A Good Question/Topic? 0
  • +

Page 1 of 1