Skip to main content
Inspiring
February 24, 2007
Question

gotoAndStop on random frame

  • February 24, 2007
  • 4 replies
  • 401 views
I have an MC called asteroid. In the script, every 1000 whatever units its in a new asteroid is attached at the center of the stage. There are two things i cant get to work. #1 i can get the asteroid to stop at a random frame(it has 100 frames). #2 after it's made and has gotten its random frame to stop at i need it's width and height to grow. Here is what I have so far:
i=1;
setInterval(rocks, 1000);
function rocks(){
rock= _root.attachMovie("asteroid","asteroid"+i, i);
i++;
rock._x = 300;
rock._y = 300;
rock.movef = setInterval(rockmove, 10);
}
function rockmove(rok){
// I dont know what to put here; what I tried did not work
}

What would I add to my script to accomplish this task?
thanks
This topic has been closed for replies.

4 replies

JimmathyAuthor
Inspiring
February 24, 2007
if i said that, I dont
kglad
Community Expert
Community Expert
February 24, 2007
try:

kglad
Community Expert
Community Expert
February 24, 2007
no, you said you already had that problem solved.
JimmathyAuthor
Inspiring
February 24, 2007
I havent attached that yet, but just looking at it it doesnt appear to gotoAndStop on a random frame from 1-100, am i wrong about that? If its not there, what do I do to make it stop on a random frame?

thanks
kglad
Community Expert
Community Expert
February 24, 2007
try: