Скачать 421.13 Kb.
1. Etheridge D. Flash ActionScript: Your Visual Blueprint for Creating Flash-enhanced Web Sites / Denise Etheridge – Visual; Pap/Cdr edition (April 5, 2002) – 320 pages.
ActionScript, Flash's scripting language, adds interactivity to a movie. You can set up your movie so that user events, such as button clicks and keypresses, trigger scripts that tell the movie what action to perform. For example, you can write a script that tells Flash to load different movies into the Flash Player depending on which navigation button a user chooses.
Think of ActionScript as a tool that allows you to create a movie that behaves exactly as you want. You don't need to understand every possible use of the tool to begin scripting; if you have a clear goal, you can start building scripts with simple actions. You can incorporate new elements of the language as you learn them to accomplish more complicated tasks.
This chapter introduces you to ActionScript as an object-oriented scripting language and provides an overview of ActionScript terms. It also deconstructs a sample script so that you can begin to focus on the bigger picture.
This chapter also introduces you to the Actions panel, where you can build scripts by selecting ActionScript elements or entering text into the Script window.
You can start writing simple scripts without knowing much about ActionScript. All you need is a goal; then it's just a matter of picking the right actions. The best way to learn how simple ActionScript can be is to create a script. The following steps attach a script to a button that changes the visibility of a movie clip.
To change the visibility of a movie clip:
ActionScript is an object-oriented scripting language. This means that actions control objects when a particular event occurs. In this script, the event is the release of the mouse, the object is the movie clip instance testMC, and the action is setProperty. When the user clicks the onscreen button, a release event triggers a script that sets the _visible property of the object MC to false and causes the object to become invisible.
You can use the Actions panel to guide you through setting up simple scripts. To use the full power of ActionScript, it is important to understand how the language works: the concepts, elements, and rules that the language uses to organize information and create interactive movies.