Groups | Blog | Home
all groups > flash actionscript > february 2005 >

flash actionscript : How can I target random frames in a movie clip?


Spindrift
2/5/2005 2:50:43 PM
Hi there, Thanks for checking my post out... In my Flash MX movie I have a
movie clip with 5 frames with a stop action in the first. Each frame (including
the first with the stop action) has a movie clip with a different dynamically
loaded JPG background image. What actions would I have to put where to make
the movie clip select a frame in the movie clip at random. I've tried a couple
of codes (below) which do work but the movie clip starts on the first frame,
showing my first image before selecting a frame at random which is annoying!
The scripts I've tried are: { numFrame = random(5)+1;
this.gotoAndStop(numFrame); } in the first frame of the movie clip and...
randompicture.gotoAndStop(Math.floor(Math.random() *
randompicture._totalframes) + 1); ...in the main timeline after naming the mc
randompicture. I would be most grateful for any assistance. Thank you very
much and I hope to hear from you. Take care,
juankpro
2/5/2005 3:07:49 PM
AddThis Social Bookmark Button