-
Controlling MC's over time
Hi,
I'm trying to load 7 different movies into a container movie clip. The container movie has the load movie command on 7 seperate frames (each frame calling in its respective clip). How do i go about getting the movie to randomly go to each of these frames whith a delay of about 5mins before it moves onto the next frame.
I'm sure it's something simple and any haelp would be greatly appreciated.
Thanks,
Barrie
-
make a function that randomly selects a number 1-7 every 5 mins. this number is then set as a variable. then in the swf make an if statement, so that it goes to differnet frames depending on what the varibale is. it also has to check contiuosly that the variable hasn't changed. you don't really need differnt keyframes for every loaded swf, you can include them in the if statement.
-
Code:
frames_array = [1, 2, 3, 4, 5, 6, 7];
gotoNextFrame = function () {
if (frames_array.length) {
randomFrame = Math.floor(Math.random() * frames_array.length);
gotoAndStop(randomFrame);
frames_array.splice(randomFrame, 1);
} else {
clearInterval(_interval);
}
};
_interval = setInterval(gotoNextFrame, 300000);
-
Thats a great help. many thanks for the code. I should probably learn more about scripting instead of working on that blasted elastic band ball.
Enjoy the rest of you day/evening,
Barrie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|