Adding ActionScript to Your Flash Animation
- The Role of ActionScript 2.0 in Flash Pro Development
- Object-Oriented and Procedural Programming
- Using the Behaviors Panel
- Using the Actions Panel
- What's Next?
- In Brief
In this chapter
-
The Role of ActionScript 2.0 in Flash Pro Development
-
Object-Oriented and Procedural Programming
-
Using the Behaviors Panel
-
Using the Actions Panel
The Role of ActionScript 2.0 in Flash Pro Development
In this seventh incarnation of Flash, ActionScript has taken on a new version name for the first time. Flash MX Professional 2004 introduces ActionScript 2.0, heralding a line of demarcation between all previous versions of ActionScript, now called ActionScript 1.0, and the new version using the ECMAScript Edition 4 standards. By following the European Computer Manufacturers Association (ECMA) standards, ActionScript 2.0 is consistent not only with other Internet languages that meet the standards, such as JavaScript 2.0, but with the wider world of object-oriented programming languages such as Java and C++.
ActionScript 2.0 is an integral part of creating a wide range of documents in Flash Pro. Rich Internet applications rely on ActionScript 2.0 because it can be used to call up external files, control objects on and off the Stage, and create interactivity in Flash movies. However, ActionScript 2.0 is only one of many tools that make up Flash. Therefore, although the documents you create with Flash will typically contain ActionScript 2.0, they are also made up of different objects created with the array of other tools found in Flash Pro.
New in ActionScript 2.0: The Behaviors Panel
Readers who are not programmers and have no aspirations along those lines should take heart. Flash Pro provides a new panel, the Behaviors panel, that automatically generates simple but effective code for you. Using the Behaviors panel is covered in this chapter. However, the other examples of ActionScript 2.0 throughout the rest of the book employ the more standard Actions panel.
In subsequent chapters, you'll use ActionScript 2.0 to create different parts of a Flash document that are needed for various tasks. The uses of ActionScript 2.0 are centered around typical parts that one would incorporate into a professional Web site using Flash Pro as the primary development tool. Therefore, when describing how to create effective I/O structures in Chapter 6, "Viewing and Entering Information with Text Fields," for example, I'll explain how to use different types of text fields, the TextField component, and ActionScript 2.0 for dynamically using the TextField and TextFormat classes along with the information entered into a text field. This integrated approach requires that you see ActionScript as just another tooland not the only toolfor making a Flash document.