Forum Moderators: open

Message Too Old, No Replies

Random Function is adobe flash

Does Adobe flash have a 'random number generator'?

         

Aussie Nuf Man

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

10+ Year Member



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?

caribguy

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

WebmasterWorld Senior Member 10+ Year Member



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.

Aussie Nuf Man

8:05 am on May 3, 2010 (gmt 0)

10+ Year Member



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.

rocknbil

5:20 pm on May 3, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



LOL . . . well apparently the computer didn't go to the dump or get mowed, this is good. :-) Yes, rand() is present in ActionScript.

Aussie Nuf Man

5:51 am on May 4, 2010 (gmt 0)

10+ Year Member



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]