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="Blue Swirl"; name="Void"; name="Zebra"; name="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 is the name of the first background, mine is called Blue Swirl. name 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 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|
Rating: 8 Votes: 38
|No details available.|
|Download the files used in this tutorial.|
|Download (15 kb)|
|More help? Search our boards for quick answers!|