At 3/9/02 07:47 AM, McRhyme wrote:
Hi, I'm working on the trivia for Ytowm Public #6 and have run into a small problem (that got huge when I didn't know how to solve it).
I have a couple of buttons with answers just like in YP#5 quiz- and this time I want to add a time limit feature. All questions lie in different frames in the same scene.
I though I could add a object with the BEAR slowly running toward NEWTON. When the bear gets close to him I want the WHOLE movie to jump to an other scene. I can't do this. Because the code it in the object's frame. And not in the main movie frames. Get it?!
HEEELP!
ok this is what you do
make all the questions and the whole quiz thing into a movie clip. Place the movie clip on the stage where it is gonna be and what not. Then right click and choose actions for the movie clip and put this in:
onClipEvent(load)
{
startTime = getTimer();
}
onClipEvent(enterFrame)
{
currentTime = getTimer();
elapsedTime = Math.round((currentTime - startTime)/1000);
}
Just copy and past that in. What it will do is count up every second. So say you want a 60 second timer. You would add:
if(elapsedTime >= 60)
{
_root.gotoAndPlay(N);
}
Where N would be the next frame in the main time line. so the overall action script for the movie clip is:
onClipEvent(load)
{
startTime = getTimer();
}
onClipEvent(enterFrame)
{
currentTime = getTimer();
elapsedTime = Math.round((currentTime - startTime)/1000);
if(elapsedTime >= 60)
{
_root.gotoAndPlay(N);
}
}