Groups | Blog | Home
all groups > macromedia flash sitedesign > april 2007 >

macromedia flash sitedesign : How can I start the Flash Movie at Random Frame


David Stiller
4/2/2007 3:42:37 PM
flashdebuton,

[quoted text, click to view]

Here's one approach.

http://www.quip.net/blog/2006/flash/how-to-jump-random-frame-label


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."

flashdebuton
4/2/2007 5:57:11 PM
do any 1 have any idea on how ti design an swf file the will be embedded in a web page, so that whenever the page is loaded or reloaded the swf file will start at a rendom frame.
David Stiller
4/4/2007 12:00:00 AM
flashdebuton,

[quoted text, click to view]

Wow, that's a more complex goal, for sure. ;) Actually, the complexity
depends on possible transitions (such as fading) that you may want to apply.
It's easy to fade from one image to the next on the timeline -- as long as
the progression is linear instead of random.

[quoted text, click to view]

There are a number of ways to achieve what you're after, but it really
depends on what you mean by "sliding." Can you give a few more details?


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."

flashdebuton
4/4/2007 12:00:00 AM
thanks alot for the reply.
I have the swf file that is nothing but a set if images and every image has
its own frame (time frame). each image appears for 20 seconds, after 20 seconds
the next one shows up and the previous one desappears.
hope that helps.
flashdebuton
4/4/2007 3:26:11 AM
thanks a lot for the help.
What I am working on is:
Let say that I have a slideshow of pic 1,2,3,4 and 5. runing in this order.
what I want to do is whenever I lounch the HTML page the order of the pic
sliding should change randomly.
Any idea?????
Thanks
David Stiller
4/4/2007 9:51:04 AM
flashdebuton,

[quoted text, click to view]

Okay.

[quoted text, click to view]

No fading, no transition? Just disappears? If so, that's the easiest
approach.

If you don't care about repeats, you could put each image on its own
frame, then use gotoAndStop(Math.ceil(Math.random() * 8)) -- or 5, or
however many frames/images you have. Use setInterval() or setTimeout() to
pause at each image as long as you like.

If you do care about repeats -- in other words, you'd like every image
to play once, and only once, during the random sequence -- your best bet is
to put your numbers (or frame labels) into an array, then shuffle that
array, then step through the array.

Search Google for the phrase "kglad shuffle" and you'll find an approach
to array shuffling pretty quickly.


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."

AddThis Social Bookmark Button