Chapter 9. Automating Flash with ActionScript


When you've got your Flash document on your PC, you're in control. You can make it do whatever you want, whenever you want. But eventually, your creation must strike out on its own. You won't be there to tell your animation what to do when someone clicks a button or remind it to turn off the sound after the first three times through. You need to provide instructions to make your animation perform automaticallythat is, automate it.

To automate your animation or make it interactive, you use ActionScriptFlash's built-in programming languageto act on, or script , the different parts of your animation. For example, you can instruct your animation to load a Web page when someone clicks a button you've added, to start playing an audio clip at the beginning of a certain scene, to play your animation in reverse, to loop certain sections of your animation, and so on.

Flash calls the chunks of ActionScript code you attach to your animation actions , which is a great reminder that ActionScript exists to help your audience interact with your animation.

Unfortunately, mastering a scripting language like ActionScript is a bit harder than mastering a regular programming language because you have to memorize not only the language itself (including syntax and basic programming concepts such as variables , functions, parameters, and so on) but also the scripting object model (the internal, Flash-designated names of all the parts of your animation and all the actions you can apply to them). Fortunately, Flash offers ActionScript wizards called behaviors that help you construct simple actions.

This chapter acquaints you with the ActionScript language, as well as the Actions panel you use to build actions and attach them to your animation. You also learn when (and how) to use behaviors to reduce the time and effort you have to spend to create an interactive animation.


Note: You'll find additional examples of scripts in Chapters 10, 11, and 12.



Flash 8
Flash Fox and Bono Bear (Chimps) (Chimps Series)
ISBN: 1901737438
EAN: 2147483647
Year: 2006
Pages: 126
Authors: Tessa Moore

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net