Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop MC

Status
Not open for further replies.

llldnylll

Technical User
May 21, 2003
89
Is there a way to make a movie wait a random number before it plays it again?


thanks,
dny
 
do you mean wait for a random number of seconds ?

if so last frame of movie clip

time = Math.round(Math.random()*10000)
paused = setInterval(wait,time);
stop();


first frame of movie clip

function wait(){
clearInterval(paused);
gotoAndPlay(1);
}



_______________________________________
You know you're old if you can remember when bacon, eggs and sunshine were good for you
 
Thanks Mr. Watson.

I put the code on some buttons with mc and it works, but when i rollover to another button quick, it conflicts with my main movie. The movie starts reapeating itself. What can i do to fix this?
 
yup the code for rollover was messing things up.


I had:

stop();
gotoAndPlay("1");


Changed it to:

stop();
gotoAndPlay("Web");

Just added an Instance Name :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top