First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Clinton Montague

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]
Remeber to put the semicolon ( ; ) after each line, this tell Flash that the line has finished. The // means that a comment follows and it is ignored by flash, so it does not need a semicolon.

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: 7.82 Votes: 39
(10 being the highest)
» Author
No details available.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

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

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.