BESTPROOFINGSERVICE.COM

color proof printer - www.bestproofingservice.com

Menu


If you receive an error, don't despair. You may simply have left out a space, semicolon, or parenthesis. Refer to the error message to see


which line contains the error. Compare your script with the one in the 07End.fla file to see how they differ. You can copy the lines of script from that file and paste them into the Actions panel in your project file. [View full size image] With ActionScript 3.0, you were able to keep the movie from playing until it had loaded and then load different text files depending on the selected button. You'll use conditional statements, event handlers, and data loaders frequently as you become more familiar with ActionScript. [View full size image]   Review Review Questions 1 What is a variable, and how do you declare one 2 What is a function 3 How can you add comments that will be ignored when the script is run 4 What is a conditional statement 5 What is an event What is an event listener Review Answers 1 A variable represents a specific piece of data, which may or may not be constant. Before you can use a variable, you need to declare it. To declare a variable, you use the var keyword, name the variable, and assign a value to it. 2 A function is a group of statements that you can refer to by name. Using a function makes it possible to run the same set of statements without having to type them repeatedly into the same script. 3 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 */. 4 A conditional statement requires the script to determine whether something is true or false, and then to act based on that determination. The most common type of conditional statement is the if statement. The if statement checks a value or expression in its parentheses. If the value is true, the lines of code in curly brackets are carried out; otherwise, they are ignored. You can add an else statement to provide alternative instructions if the condition is not true. 5 An event is something that is initiated by a button click, a key press, or the end of a video. An event listener, also called an event handler, is a function that is executed in response to specific events.   8. Using Components [View full size image] Components are prebuilt movie clips that give you a head start, especially when you are creating user interface elements such as scroll bars, menus, and text fields. Lesson Overview In this lesson, you'll learn how to do the following: * Add a simple component to a project * Modify a component's parameters