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:

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

1,312 Responses to “ActionScript 3.0 Lesson 11: How to Create a Timer in Flash”

  1. eating to build muscle and lose fat Says:

    Hello, you used to write fantastic, but the last few posts have been kinda boring¡K I miss your super writings. Past several posts are just a little out of track! come on!

  2. buy adderall online Says:

    Gny2Tq Add New Comment thanx for the option

  3. waste disposers Says:

    Thank you for some other great post. The place else may just anybody get that kind of info in such a perfect manner of writing? I have a presentation next week, and I’m at the look for such info.

  4. order arcoxia Says:

    SowqHz i dont know if that is really true

  5. sleeping problems Says:

    Insomnia can be a dangerous condition. Resolving it fast is crucial as allowing it to worsen will bring more serious health difficulties.
    Drugs are not an answer because they can lead to dependency and they exacerbate the situation in the long term. Natural solutions to sleeping problems should always be sought first.

  6. example of good online dating profile Says:

    Many thanks for posting this, It?s simply what I used to be researching for on bing. I?d a lot relatively hear opinions from an individual, barely than a company web page, that?s why I like blogs so significantly. Many thanks!

  7. Mobilya Dekorasyon Says:

    Wow , its great blog! you made blogging look easy. How long have you been blogging for? I’m confident they’ll be benefited from this web site.

  8. titanius shnobelus Says:

    I am amazed with the abundance of interesting articles on your site! The author – good luck and wish you the new interesting posts..!

  9. food to avoid with acid reflux Says:

    Along with every little thing which seems to be developing within this subject matter, your points of view are rather refreshing. However, I appologize, but I do not subscribe to your entire idea, all be it refreshing none the less. It seems to me that your comments are not totally justified and in fact you are yourself not fully convinced of the argument. In any case I did enjoy reading it.|I do like the way you have framed this issue and it does give me some fodder for thought. However, from what I have seen, I just hope as the comments pile on that people stay on point and not embark on a tirade of the news du jour. All the same, thank you for this excellent point and although I do not agree with it in totality, I respect your point of view.|Most of what you say is supprisingly accurate and it makes me wonder why I hadn’t looked at this in this light before. This piece really did turn the light on for me as far as this topic goes. But there is one point I am not too comfortable with and while I try to reconcile that with the central theme of your point, let me see what the rest of your readers have to say.Well done.|The crux of your writing while sounding agreeable initially, did not sit well with me after some time. Somewhere within the paragraphs you managed to make me a believer but only for a while. I still have a problem with your leaps in assumptions and you would do well to fill in those gaps. If you can accomplish that, I would certainly be impressed.|In the grand scheme of things you get an A+ for effort. Where you lost me was in the details. As they say, details make or break the argument.. And it could not be more true here. Having said that, let me tell you what did work. Your writing is very persuasive and that is probably why I am taking the effort to comment. I do not make it a regular habit of doing that. Second, while I can see the jumps in logic you make, I am not sure of how you seem to connect the points which make the conclusion. For now I shall subscribe to your point but hope in the future you connect the dots better.}

  10. urgent care Says:

    That’s a great post!


Trackbacks/Pingbacks

  1. cat toys says:

    Yahoo results…

    While browsing Yahoo I discovered this page in the results and I didn’t think it fit…

  2. guarantee card in order to have more…

    security. in future, if anything happens to the product you can simply get it repaired or exchanged by the manufacturer with the help of warranty or guarantee card. hence do not waste time in purchasing anything from the local market. go…

  3. brisket.some people consider the use of curing…

    agents such as morton tender quick to be cheating as they feel a smoke ring should only be generated by smoke. it has been proposed that it is possible to tell which smoke rings have been faked with dry cure agents…

  4. Here says:

    Sites we Like……

    [...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……

  5. Hello…

    F*ckin’ tremendous issues here. I’m very happy to see your post. Thanks a lot and i’m looking forward to contact you. Will you please drop me a e-mail?…

  6. Hi…

    I like this post, enjoyed this one thank you for posting. “I never let schooling interfere with my education.” by Mark Twain….

  7. be the subject of lease negotiation. you…

    will need copies of the lease offers that are or have been made and the status of the existing negotiations. details of the maintenance issues within the building will be required. the essential services within the building will be critical maintenance…

  8. or they would just pick it up…

    at a later time. this is the convenience that only telemarketing gives.now, before critics begin saying that telemarketing is bad for business, remember that this is the medium that the live answering service works on. without this, then there is no…

  9. Tumblr article…

    I saw someone talking about this on Tumblr and it linked to…

  10. spyware says:

    Online Article……

    [...]The information mentioned in the article are some of the best available [...]……

  11. Bored at work…

    I like to browse in various places on the online world, often I will go to Digg and read and check stuff out…

  12. you should keep in mind is that…

    when you reduce your calorie intake your body will adapt to the changes and slow down your metabolism and your body’s fat burning abilties.when you return to stop taking the “secret” diet pills and return to eating normally again your body…

  13. Its hard to find good help…

    I am regularly saying that its difficult to find quality help, but here is…

  14. Hi…

    Very wonderful information can be found on site….

  15. Hi…

    I truly appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You’ve made my day! Thx again!…

  16. You should check this out…

    [...] Wonderful story, reckoned we could combine a few unrelated data, nevertheless really worth taking a look, whoa did one learn about Mid East has got more problerms as well [...]……

  17. Informative and precise…

    Its difficult to find informative and precise info but here I noted…

  18. Wikia…

    Wika linked to this place…

  19. Bankrecht says:

    Rechtsanwalt Martin Nürnberg…

    Rechtsanwalt Nürnberg…

  20. Awesome website…

    [...]the time to read or visit the content or sites we have linked to below the[...]……

  21. rhino says:

    Hey…

    What i don’t understood is actually how you’re not actually much more smartly-favored than you might be right now. You’re so intelligent. You realize therefore considerably in relation to this subject, made me individually consider it from a lot of …

  22. Gems form the internet…

    [...]very few websites that happen to be detailed below, from our point of view are undoubtedly well worth checking out[...]……

  23. Hey…

    I enjoy your writing style really loving this site. “Make no judgements where you have no compassion.” by Anne McCaffrey….

  24. Websites worth visiting…

    [...]here are some links to sites that we link to because we think they are worth visiting[...]……

  25. draw manage says:

    News info…

    I was reading the news and I saw this really interesting topic…

  26. Recent Blogroll Additions……

    [...]usually posts some very interesting stuff like this. If you’re new to this site[...]……

  27. Awesome website…

    [...]the time to read or visit the content or sites we have linked to below the[...]……

  28. Read was interesting, stay in touch……

    [...]please visit the sites we follow, including this one, as it represents our picks from the web[...]……

  29. Recent Blogroll Additions……

    [...]usually posts some very interesting stuff like this. If you’re new to this site[...]……

  30. Great website…

    [...]we like to honor many other internet sites on the web, even if they aren’t linked to us, by linking to them. Under are some webpages worth checking out[...]……

  31. Gjeld says:

    Visitor recommendations…

    [...]one of our visitors recently recommended the following website[...]……

Leave a Reply

Security Code:

Free PageRank Checker

$7.49 .Com! Score Savings Cartoon Smart Tutorials

oDesk Certified Action Script Programmer oDesk Certified Adobe Flash CS3 Designer oDesk Certified Adobe Photoshop 6.0 Designer

3,036
Unique Visitors
Previous 30 Days
Powered By Google Analytics