Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

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

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-29-2002, 05:48 PM   #1
kunafish
Registered User
 
Join Date: Dec 2001
Posts: 4
Question Game "Time Delay" after question is answered

newbie here,

- creating a "jeopardy" like game in Flash 5.

- need help on creating a 'time delay" (about 6 seconds) after the user answers a question (either correctly or incorrectly. the question box pops up, user answers, end result is visible for 6 seconds, then fades out)

- i have my main stage. A mc placed on the main stage contains the question/answer box. I would like to have, say, an action that occurs when the user click on the answer (or question in this jeopardy game). When the person reaches a particular frame (in this mc) , a counter starts, going up to 6 seconds, then proceeds onto closing the mc (or fading it out, whatever).

something to the effect of:

pause=6*1000
...... (something goes here .... I don't know what though)

if(getTimer() > pause) {
gotoAndPlay (22);
}

what do I do here?

i know getTimer() has something to do with it. i understand that it counts from when the main movie starts. I want it to start counting when the person hits, say, frame 18.

i've checked out the tutorial, but it has everything occuring on the main stage. I want mine occuring in the movie clip. i've tried, but have just gone mad.

if anyone can point me in the right direction, i'd appreciate it!

chanx
kunafish is offline   Reply With Quote
Old 07-29-2002, 08:04 PM   #2
Grifter
hopeful
 
Join Date: Apr 2002
Posts: 248
Default

you need to set a variable that is equal to the time that the user answers the question.
ActionScript Code:
//on a button for answering the question on(release){ _root.answered = getTimer(); } //on a movieclip onClipEvent(load){ _root.pause = 6 * 1000; _root.answered//INSERT REALLY HIGH NUMBER HERE - i think you can use Math.Max or something but can't remember if that's the proper name } onClipEvent(enterFrame){ if(getTimer() > (_root.answered + _root.pause)){ gotoAndPlay(22);   //  or whatever you want to do here } }


and that should do the trick (i think).

Regards
Grifter

Last edited by Grifter; 07-29-2002 at 09:09 PM..
Grifter 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
Swapdepth using txt files and dynamic content for game. superbnerb ActionScript 1.0 (and below) 3 09-22-2004 08:27 PM
2 Player Game Question JayDuck12 ActionScript 1.0 (and below) 9 04-27-2004 03:41 AM
Flash game developpement question. alphabug Gaming and Game Development 2 09-03-2003 03:13 PM
Another Game Timer question (MX) friz2002 Gaming and Game Development 13 04-17-2003 01:47 AM
a tough question on controling the hit rate of prizes for a game crasher11 Gaming and Game Development 9 10-15-2001 07:20 PM


All times are GMT. The time now is 06:59 PM.


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