First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
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: 8 Votes: 38
(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: S.Saipriya
» Title: Flash Fire Effect
» Description: This tutorial explains about how to create Fire Effect in Flash of Actionscript 2.0.I hope this tutorial helps you!
Featured Sound Loops
Image for equalize

Audio Player

» Author: Aidan Crouzet-Pascal
» Title: Falling Star
» Description: This loop is a cool sounding, E minor loop.
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: Brandan Paulin
» Description: Epic sounding loop with Brass, Percussion, Strings and Winds. This is actually part of a Loop Pack called the Coming where you can download the rest of the loops that go with it FREE from my website.