homepage Welcome to WebmasterWorld Guest from 23.20.63.27
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
Random Function is adobe flash
Does Adobe flash have a 'random number generator'?
Aussie Nuf Man




msg:4125887
 12:32 am on May 3, 2010 (gmt 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?

 

caribguy




msg:4125902
 1:32 am on May 3, 2010 (gmt 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.

Aussie Nuf Man




msg:4125973
 8:05 am on May 3, 2010 (gmt 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.

rocknbil




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

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




msg:4126518
 5:51 am on May 4, 2010 (gmt 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]

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved