having to type them repeatedly into the same script. For example, you could script a button to scale a movie clip by a certain percentage. The script might contain three lines. That's fine for one button, but if you want five buttons to perform the same task, you can create a function that contains three lines, and then refer to the function name to apply those lines of code for each button. Class In ActionScript 3.0, every object is defined by a class, which is an abstract representation of an object. You've already worked with MovieClip and Button classes in Flash. A class is a category of objects that share the same methods and properties. For example, if Dog is a class, its properties include four legs, fur, and a tail. ActionScript contains more than 100 built-in classes, which are the predefined data types you use to make things work. To access the methods and properties associated with a class, you have to create an instance of the class by declaring the variable and setting its data type. Scope The scope defines the area in your Flash file in which a variable can be referenced: local, global, and timeline. Local variables are referenced only in a certain area, such as a frame or a function. As soon as that area stops executing, the local variable no longer exists. In a function, a local variable is declared between the curly brackets {}. Global variables are available anywhere at any time to anything. You can declare a global variable and then use it in other frames as well as in other SWF files or movie clips that are loaded into the main movie file. Timeline variables are available only to any script within the same Timeline. After a variable is declared on a Timeline, it is available to all the frames that follow. Methods Methods are the keywords that result in action. For example, two methods associated with the MovieClip class are stop() and gotoAndPlay(). Properties Properties describe the object in a class. For example, the properties of a movie clip include its height and width, x and y coordinates, and scale. Using Proper Scripting Syntax If you're unfamiliar with program code or scripting, ActionScript code may be challenging to decipher. Once you understand the basic syntax, which is the grammar and punctuation of the language, you'll find it easier to follow a script. * The semicolon at the end of the line tells ActionScript that it has reached the end of the code line and to go to the next line in the code. * As in English, every open parenthesis must have a corresponding close parenthesis, and the same is true for brackets and curly brackets. If you open something, you must close it. * The dot operator (.) provides a way to access the properties and methods of an object. Type the instance name, followed by a dot, and then the name of the property or method. * Whenever you're entering a string or the name of a file, use quotation marks. * You can add comments that ActionScript won't read to remind yourself or others what you are accomplishing with different parts of the script. To add a comment for a single line, start it with two slashes (//). To type a multi-line comment, start it with /* and end it with */. Flash provides assistance in the following ways as you write scripts in the Actions panel: * Words that have specific meanings in ActionScript, such as keywords and statements, appear in blue as you type them in the Actions panel. Words that are