-
randomly loaded jpeg's
I'm sure this is covered somewhere here but, can someone tell me how or where to get instructions on having a different jpeg load into my flash movie each time the site is visited? Like, for a different background photo whenever someone revisits the site.
Thanks,
dixter
-
FK's Geezer Mod
The pics have to be named and numbered in sequence, starting with '0'. It would be better if you made the jpg's into swf's, but I think this would work for jpg's in MX. You also have to have an empty movie clip at the top left corner of the stage, on the lowest level. Give it an instance name of 'background'.
On the first frame of the actions layer, add:
Code:
backgrounds = new Array ("background0.jpg", "background1.jpg", "background2.jpg", "background3.jpg");
function randomBackground() {
randomNumber = random (backgrounds.length);
loadMovie (backgrounds[randomNumber], "_root.background");
}
randomBackground();
-
Awesome! Thanks tons!
dixter
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
|