Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > General > Gaming and Game Development

Reply
 
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Old 02-25-2008, 07:03 PM   #1
louise88
Registered User
 
Join Date: Dec 2007
Posts: 8
Default create a 2minute timer

Hi,

I have tried looking for tutorials on timers but am a bit confused. How would i create a 2 minute timer that counts down. The timer would begin on the startGame function?

Any help would be appreciated!
louise88 is offline   Reply With Quote
Old 02-26-2008, 03:53 PM   #2
rrh
Senior Member
 
Join Date: Dec 2006
Posts: 1,252
Default

AS2?

http://www.dreamincode.net/code/snippet122.htm

Found by googling actionscript timer
rrh is offline   Reply With Quote
Old 03-10-2008, 04:31 AM   #3
sasuke
Registered User
 
Join Date: Jan 2008
Posts: 8
Default

http://www.flashcomponents.net/autho...binkhalid.html
sasuke is offline   Reply With Quote
Old 03-10-2008, 06:08 PM   #4
Durnus
Senior Member
 
Join Date: Mar 2007
Posts: 257
Default

This is really simple to do. Depends on the timer you want to use though. Are you asking for graphical representation of the time, or just something that executes a function after X seconds?

AS2:
ActionScript Code:
function toExecute() {} setInterval( 1000 /*This is any number of milliseconds, 1000 in one second.*/, toExecute /*The function to execute after the number of milliseconds.*/);

AS3:
ActionScript Code:
var timer:Timer = new Timer(1000); timer.addEventListener(TimerEvent.TIMER, functionToExecute); function functionToExecute(e:Event) {} //Same idea applies here, 1000 is in milliseconds, and if you are using AS3 you should know AS3 well enough to get this code.

All I can tell you is this: Do NOT buy some sort of device to keep time unless it is exactly what you wanted and you can't get help. You can get your help here for free, and actually I'll do it for you if you want to once I get to my home computer. (At school right now.)

Good luck.
Durnus is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Timer issues shadwickman ActionScript 2.0 0 05-22-2006 07:28 PM
create multiple textfields on selection mantra Components 2 04-09-2006 06:46 AM
How to change a Text from a Timer Callback sylvesp ActionScript 2.0 2 04-07-2006 01:49 AM
using timer prototype: not able to use inside another function sbhar ActionScript 2.0 0 11-11-2005 09:39 AM
reset timer blaatorx ActionScript 1.0 (and below) 0 05-19-2005 08:56 AM


All times are GMT. The time now is 03:00 AM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2010 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.