Search tutorials
The Code Explained...
Define the number of footers you will have:
footers = 4;
Define the root footer directory where all your footers will be stored:
directory = "http://www.mysite.com/footer/";
Loads the movie:
loadMovie(directory add Math.ceil(Math.random()*footers) add ".swf",_level0);
Indepth
Create a random number between 0 and 1:
Math.random()
Times the footers var to get a random number between 0 and footers:
Math.random()*footers
Ceiling the number to get a integer between 1 and footer:
Math.ceil(Math.random()*footers)
Suffix ".swf" to make a filename:
Math.ceil(Math.random()*footers) add ".swf"
Prefix the root directory to make a filepath:
directory add Math.ceil(Math.random()*footers) add ".swf"
And load it in the layer0 to overwrite anything you might have put there:
loadMovie(directory add Math.ceil(Math.random()*footers) add ".swf",_level0);
| » Level Intermediate |
|
Added: 2001-10-18 Rating: 7 Votes: 123 |
| » Author |
| No details available. |
| » Download |
| Download the files used in this tutorial. |
| Download (4 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!