Welcome to WebmasterWorld Guest from 54.196.244.186

Forum Moderators: open

Message Too Old, No Replies

Random Function is adobe flash

Does Adobe flash have a 'random number generator'?

     
12:32 am on May 3, 2010 (gmt 0)

New User

5+ Year Member

joined:May 2, 2010
posts: 11
votes: 0


I'm very new to actionscript in Adobe Flash CS4.

What I have created is a 780x75px movie that scrolls images from right to left.

Is there a way to randomize the image order? I.e., If i make it scroll 'empty boxes' and make all images the same size as the empty box then randomly apply image to box or something like that?
1:32 am on May 3, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Feb 16, 2007
posts:846
votes: 0


Flash includes a pretty good scripting language: ActionScript, with similarities to JavaScript. Try hitting the F1 key and searching for 'random' - you'll find a complete reference and examples :)

One way to achieve the effect you want is to create a container movie object, and fill each instance according to a list of image urls.
8:05 am on May 3, 2010 (gmt 0)

New User

5+ Year Member

joined:May 2, 2010
posts:11
votes: 0


all good. i've sorted it out. and by sorted it out I mean it got too hard and ended up doing the mowing and a dump run.
5:20 pm on May 3, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


LOL . . . well apparently the computer didn't go to the dump or get mowed, this is good. :-) Yes, rand() is present in ActionScript.
5:51 am on May 4, 2010 (gmt 0)

New User

5+ Year Member

joined:May 2, 2010
posts:11
votes: 0


I have gone away from actionscript and have ended up using css. My site can be located at <snip> if you feel so inclined.

I have another question regarding CSS but I'll post it in the appropriate section.

[edited by: eelixduppy at 12:24 pm (utc) on May 4, 2010]
[edit reason] No personal URLs please [/edit]