View Full Version : Random Pictures
SBV
June 24th, 2003, 02:41 PM
Yes i used the search feature and found a topic for it, but the link they said the help was on, did not work..
How can i create random pictures?
liam
June 24th, 2003, 02:55 PM
SBV -
by "random pictures" do you mean displaying a random image or creating a random composition out of various movie clips?
let me know and i'll help you out.
SBV
June 24th, 2003, 03:16 PM
Displaying a random image.
blah-de-blah
June 25th, 2003, 08:18 AM
Well i think there is a way to do this using arrays, but i dont' know how...so an idea would be to create a random number and a picture loads up depending on the number....
Cello
June 25th, 2003, 09:15 AM
SBV - this link might help...
http://www.kirupa.com/developer/mx/loadingrandombackground.htm
:)
Cello
blah-de-blah
June 25th, 2003, 09:54 AM
damm i wanted to see how to do it too but hte second page link don't work :-\
zylum
June 25th, 2003, 06:27 PM
just make sure that all your pics are in MCs. delete all the pics off the main timeline and hit F11. right click each MC and hit linkage. you should see some check boxes. hit export for actionscript and name each MC the same except for a different number at the end ie: pic1, pic2 etc... make sure the numbers are consecutive. then in the main timeline put
numPics = 5 //the number of the last pic ie pic5
picIndex = Math.floor(Math.random() *numPics)
_root.attachMovie("pic" + picIndex, "whatEverYouWantTheNewPicNamed",100/*the new depth*/ )
_root["whatEverYouWantTheNewPicNamed"]._x = 200 //where ever you want the new pic to be placed...
_root["whatEverYouWantTheNewPicNamed"]._y = 234
that should work... haven't tested it though :)
planetfour
June 25th, 2003, 06:54 PM
zylum, excuse me I'm still learning (with quite a bit of hewlp from this place, actually:thumb: )...
The AS above implies an x and y position of the images to be 200 and 234, right ? That can be changed for any project, right?
Thanks!
Mars
edit: read the comments, Mars...:trout:
blah-de-blah
June 25th, 2003, 11:50 PM
yes it should planet :)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.