|
In Macromedia Flash MX, you can use the object-oriented
features of ActionScript to create object types (generally
called classes) that include event-handling methods. This
ability allows you to "prepackage" movie clips
with event handlers. Here's the basic process for this time-saving
technique: You first create a particular class in ActionScript.
You then define how movie clips associated with that class
will behave by adding event handlers to the class definition.
Finally, you connect your class with a particular movie
clip by "registering" the class with the movie
clip's linked indentifier in the Library.
Once this process is complete, Macromedia Flash MX automatically
associates your class and its event handlers with every
instance of the movie clip. Moreover, Macromedia Flash MX
provides ways to set up each new instance of the movie clip
with its own unique property values before it appears in
the movie. This tutorial provides a simple example of how
to do this, followed by a more extended puzzle game example.
|