Groups | Blog | Home
all groups > flash actionscript > december 2006 >

flash actionscript : Set the duration of a movie clip


johk
12/18/2006 10:49:34 PM
Hi,
I have a moviclip that I want to play for a set duration. The MC only contains
a couple of frames. I know I can just adjust the the amount of frames in the
movie clip to get the desired length but it seems to be a bit tedious. Are
there a way to set for how long I want the movie clip to play say 1.00 min?

Thanks

Jonas
superfineshag
12/19/2006 2:22:52 PM
make a new layer, then make a new movieclip in the same timeline you want to
control. It doesn't matter what it looks like as you'll make it invisible in a
mo.

Click on the movieclip and put this action on it:

onClipEvent (load) {
_visible = false;
setInterval(function () {
_parent.stop();
}, 5000);
}

The _visible bit makes it invisibile
The number is the time in milliseconds before the clip will perform the
function (ie make it stop)
AddThis Social Bookmark Button