ActionScript 3.0 Lesson 11: How to Create a Timer in Flash

Thu, Aug 6, 2009

ActionScript


On this flash action script 3.0 tutorial we create a timer that runs for 1000 milliseconds over 15 times.

This tutorial has background music., Pink Floyd TIME instrumental.

CLICK HERE FOR A COMPLETE TIMER AND TIME FOR FLASH ACTIONSCRIPT 3.0 CARTOON SMART TUTORIAL

Here is the Code

// Let’s create TIMER OBJECTS
// Let’s add a COUNTER !

var myTimer = new Timer(1000,15);

// One SECOND is made of 1000 MILISECONDS
// So the timer runs for 1 SECOND
// This will run 15 times for one second each.

// Lets create EVENT HANDLERS

myTimer.addEventListener (TimerEvent.TIMER, TickTack);
myTimer.addEventListener (TimerEvent.TIMER_COMPLETE, timerFinished);
// recognized words become BLUE
// TickTack is the name of a function we created. Can be any name.
// The function has to exist otherwise returns an error

function TickTack (e:TimerEvent):void // Our function is returning NO VALUE… void.

{
trace (” One Second… “); // The text in quotes is GREEN
}

function timerFinished(e:TimerEvent):void {

trace (“Time is up… thanks for watching”);

}

myTimer.start();

Download the Source Files
TimerEvents2Final

Related Articles:

, , , , , , , , , , , ,

One Response to “ActionScript 3.0 Lesson 11: How to Create a Timer in Flash”


Trackbacks/Pingbacks

  1. Home Page says:

    great info…

    discover here…

Leave a Reply

You must be logged in to post a comment.

My name is Avraham Saltoun, and I live in Jerusalem, Middle East. I am currently on my mid  40's and I am a computer programming technician. Here you will find over one hundred quality video tutorials on Actionscript, and yes, I give online support for aspiring programmers, and pros as well, sharing screen on skype and delivering source code by email, click the button for live flash actionscript support now!

 
oDesk Certified Action Script Programmer
oDesk Certified Adobe Flash CS3 Designer
oDesk Certified Adobe Photoshop 6.0 Designer
Skype Me™!

$7.49 .Com! Score Savings Cartoon Smart Tutorials


839
Unique Visitors
Previous 30 Days
Powered By Google Analytics