PDA

View Full Version : Flash Movie Quirk



mobilebadboy
08-01-2004, 03:29 PM
This has me stumped. I've studied it and it has no consistent faults.

I've got a small movie that flashes through 20 frames (timeline (http://christumcmobile.com/temp/timeline.gif)) and at certain frames I have a stop/pause action (stop, then pause for 3 seconds). You can see which frames. Anyway, depending on circumstance, the movie starts ignoring the 3 second pause. It mostly seems to attribute to doing something else in another window. That's the only time I've seen the issue.

I just watched it for 3 minutes and nothing. I then refreshed the site and watched it for another 2 minutes. Nothing. Then I opened Flash and took the above screenshot of the timeline, and then pasted into Photoshop and all, saved it. Then looked at the site again and it was zipping right through the frames, no pauses.

My mom said something about it. But nothing to lead me to know that she moved to other windows. She said she had the site up, talked to some people in her office, did some various office work and then looked back at her computer and the same thing, pauses being ignored. Again I don't know if she moved to any other winodws, but it's the only time I've noticed the fault.

My AS (on each marked frame above in the timeline):



stop();
var pauseDuration = 3000;
setInterval(this, "play", pauseDuration);

Anyone know if this is just a freak thing, or what?

Best.Flash
08-01-2004, 03:40 PM
I wouldn't have thought that setInterval call would work at all as its calling an internal function anyways try this:




stop();
var intervalID;
var pauseDuration = 3000;
function playMovie() {
play();
clearInterval(intervalID);
}
intervalID = setInterval(playMovie, pauseDuration);

mobilebadboy
08-01-2004, 03:51 PM
It works just fine, usually. I got that code from Colin Moock along time ago.

You can see it working here: http://christumcmobile.com.

It just has a quirk, that does or does not happen, sometimes. Heh. I just tried it now, and it ignored every other pause. *shrug* I'll try that code later and see if it makes any difference.

Best.Flash
08-01-2004, 05:20 PM
Didn't know you could use the setInterval like that, :cool:

In that case Id say it because your not clearing the Interval each time its called so from time to time the play command is called when your movie should be paused.

try this



// frame 4
stop();
var pauseDuration = 3000;
var intervalID;
intervalID = setInterval(this, "play", pauseDuration);

// frame 5
clearInterval(intervalID);

// frame 8
intervalID = setInterval(this, "play", pauseDuration);

etc.

mobilebadboy
08-02-2004, 05:43 AM
Well, it seems that's fixed it. Thanks. :)