ActionScripting
The Variables
Double click on the frame in the Variables layer and type in the following script (I suggest you use Expert Mode.)
a=1; //Names of the Backgrounds name = new Array(); name[1]="Blue Swirl"; name[2]="Void"; name[3]="Zebra"; name[4]="Citrus"; textName=name[a]
All this script does is sets up the initial conditions for the background (which one it is and what the names are). The variable a will become clear in a minute, and the other part is an array. The array holds information and sends out different parts of it according to what Flash asks for. name is the name of the array, it holds the names of the backgrounds so that flash can ask what the background is called. The name[1] is the name of the first background, mine is called Blue Swirl. name[2] is the name of the second background and so on.
Remeber that you created a text box and the variable name was textName? Well this is where is is used. The textName=name[a] tells flash to look into the array, and take out the peice of information that is stored in whatever number a is. To start of with a is 1 (at the top os the script), so the text box will have the peice of information at name[1] which is Blue Swirl.
The Button Script
It is the scripts in the buttons that actually changes the backgrounds and makes the movie tick.
| » Level Intermediate |
|
Added: 2001-03-14 Rating: 8 Votes: 38 |
| » Author |
| No details available. |
| » Download |
| Download the files used in this tutorial. |
| Download (15 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!