Реферат на тему: «Принципы и методы программирования с использованием средств Macromedia Flash»

Скачать 421.13 Kb.
НазваниеРеферат на тему: «Принципы и методы программирования с использованием средств Macromedia Flash»
Размер421.13 Kb.
1   ...   5   6   7   8   9   10   11   12   13

Список литературы

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.

Understanding ActionScript


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.

About scripting in ActionScript

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:


Choose Window > Common Libraries > Buttons, and then choose Window > Common Libraries > Movie Clips. Place a button and a movie clip on the Stage.


Select the movie clip instance on the Stage, and choose Window > Panels > Instance Properties.


In the Name field, enter testMC.


Select the button on the Stage, and choose Window > Actions to open the Actions panel.


In the Object Actions panel, click the Actions category to open it.


Double-click the setProperty action to add it to the Actions list.


From the Property pop-up menu, choose _visible (Visibility).


For the Target parameter, enter testMC.


For the Value parameter, enter 0.

The code should look like this:

on (release) {

setProperty ("testMC", _visible, false);



Choose Control > Test Movie and click the button to see the movie clip disappear.

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.
1   ...   5   6   7   8   9   10   11   12   13

Разместите кнопку на своём сайте:

База данных защищена авторским правом ©referat.znate.ru 2014
обратиться к администрации
Школьные рефераты
Главная страница