Using GetTimer to pause a movie problem

I am working on a project, and I am trying to incorporate the get timer to pause a movie tutorial. I have a main movie and my second movie(2nd movie) that is being placed on the main stage. In my second movie I have two other movies with the get timer tutorial being implemented to pause those two movies. The problem that I am having is that my movies don’t seem to pause, and for some reason I am having a difficult time lining up my two movies. They are supposed to play one after the other and in place of the first, once the pause has lapsed. I am providing the .fla I hope I haven’t confused anyone. Any help would be appreciated.

Thanks in Advance
Bonafide

I think you forgot to either attach the FLA, or post the link to it… :stuck_out_tongue:

Sorry, here is the link

http://www.flexfinity.com/pause/pausemovieprob.fla

Ok… what’s supposed to happen in the movie? vogue1 plays, pause, vogue2 plays, pause, main timeline plays? :-\

yeah vogue 1 plays, pause then vogue 2. The reason there is a main timeline is because in the actual movie that I am working on those movies (vogue1 and vogue 2) will be sitting in another movie (one that contains the two(both vogues)) with the pause that will be place on the main time line

Uhmm… like this? [EDIT]File no longer available[/EDIT].

In case I misunderstood, the code should give you a better idea at least.

PS. Please let me know as soon as you get the file, I have to delete it shortly. Thank you.

Kode, thanks. That is the effect I want. Now I have to try and understand the code. Thanks for getting me on my way.

Bonafide

You’re welcome, bonafide. :wink:

And well, I don’t remember the code I used and I already deleted the files. :stuck_out_tongue:
Post it here and I’ll try to explain it to you. :slight_smile:

Code:
[AS]var timer;
var pause = 1000;
this.onEnterFrame = function() {
if (vogue1._currentframe == vogue1._totalframes) {
if (!timer) timer = getTimer();
if (getTimer()-timer>=pause) {
this.nextFrame();
}
}
};
this.stop();[/AS]

In the first two lines of the code the variables are defined. No problems here, right?
[AS]this.onEnterFrame = function() {[/AS]
This line defines the function that will be executed in the onEnterFrame handler.

onEnterFrame handler: http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary546.html.
[AS]if (vogue1._currentframe == vogue1._totalframes) {[/AS]
Checks if the current frame of the MovieClip instance, vogue1, equals its total frames. Which would mean the animation has finished.

_currentframe property: http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary514.html.
_totalframes property: http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary576.html.
[AS]if (!timer) timer = getTimer();[/AS]
If the variable timer is not defined yet, sets the variable equal to the time (milliseconds) elapsed since the movie started.

getTimer function: http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary376.html.
[AS]if (getTimer()-timer>=pause) {[/AS]
Checks if the difference between the milliseconds returned by getTimer and the milliseconds when the animation finished, is greater than or equal to the pause value.
[AS]this.nextFrame();[/AS]
Sends the playhead to the next frame of the MovieClip.

nextFrame method: http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary542.html.
[AS]this.stop();[/AS]
Stops the MovieClip.

stop method: http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary569.html.

…The end. :stuck_out_tongue: