• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 13. Interactivity with Objects > Adding Actions to Movie Clips

Adding Actions to Movie Clips

Just as you can attach ActionScripts to button instances, you can attach ActionScripts to movie-clip instances. Movie clip ActionScripts require a specific handler (onClipEvent) that encompasses its own set of event parameters. Movie clips can respond to mouse events (such as pressing the mouse button or moving the mouse), keyboard activity (such as pressing a certain key), the activity of the movie clip itself (such as loading into the main Timeline), and the receipt of data (from variables).

The Mystery of Deprecated Actions

As any language evolves, new words and expressions become standard and old terms fall out of everyday use. You can continue to speak and write with the older words, but as time passes those antiquated words become unintelligible to modern speakers. The same is true for scripting languages, where the term deprecated is used to designate "words," pieces of code, that still work but are superceded by more recent code.

ActionScript in Flash 5 is a much fuller language than its Flash 4 counterpart, and several Flash 4 actions are now deprecated. Flash 5 continues to support the deprecated actions, and they are compliant with ECMA-262—a set of specifications for the JavaScript language developed by the European Computers Manufacturers Association (ECMA). A day may come, however, when that's no longer true. So it makes sense to switch to the new actions as soon as you can.

To see which actions are deprecated, in the Publish Settings dialog box, set Flash to export version 5. (For more information on publishing Flash movies, see Chapter 16.) In the Actions panel, open the Actions, Operators, Functions, or Properties categories in the Toolbox List. Flash highlights the deprecated actions in green.

Flash does not highlight deprecated actions in the Basic Actions set, but that set does contain three deprecated actions in the Actions List: Toggle High Quality, If Frame Is Loaded, and Tell Target. Because the Basic Actions set offers more assistance to beginning scripters, it can be useful to start scripting with these actions, even though they are deprecated. As you get more familiar with scripting, you can switch to the newer actions for accomplishing the same things.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint