-
Random Image Insert
Hello,
I am trying to create a placeholder on my flash page that will import images randomly from a file. Basically on my page I would like to have a box that will display jpegs randomly from a file. Can someone point me in the right direction as to how I can accompish this? Thank you.
-
FK's Geezer Mod
Code:
randomClips = new Array ("background0.jpg", "background1.jpg", "background2.jpg", "background3.jpg");
function randomBackground() {
randomNumber = random (randomClips.length);
_root.mtClip.loadMovie (randomClips[randomNumber]);
}
randomBackground();
Put that in a frame. When the movie loads or reloads, it will show a random picture. The more jpg's in the array, the more random it will be.
-
Thank you
-
Is there a way to reference the jpg's from a file rather than hard coding them? I would like to be able to use the same code in multiple swf's and add/remove the images from one location (file) rather than going into each swf and changing the code each time I want to add or remove a picture. Thank you.
-
FK's Geezer Mod
I don't know of an easy way, but I'm sure there is one. Ask in the actionscript forum.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|