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

Chapter 6. Customizing Objects > UNDERSTANDING OBJECT MECHANICS

UNDERSTANDING OBJECT MECHANICS

In Lesson 4, we introduced you to Flash’s prebuilt objects (the objects listed in the Toolbox window of the Actions panel). In that lesson you created instances of prebuilt objects, changed their properties, and used various methods to make the objects perform specific tasks. In the process you got a taste of how objects facilitate interactivity. However, we couldn’t explain why objects work the way they do until you understood functions, since these play a critical role in the creation and customization of objects. Now that you know something about functions (which we covered in Lesson 5), you’re ready to get down to the real nitty-gritty of creating and customizing objects.

Creating Instances of Objects vs. Classes of Objects

Right about now you may be saying, “But I thought I created and customized objects in Lesson 4; how is what we’re going to do here different?” Well, in Lesson 4 you created instances of prebuilt objects (for example, an instance of the Color object)—objects that are built into ActionScript and thus immediately available for use. We showed you the different classes of Flash’s built-in objects (Array, Color, Date, String, Sound, and so on), but we didn’t explain how to build your own class of objects (that is, your own custom tools) or how to enhance existing ones. To return to an earlier analogy, when the automobile was invented, a new class of objects was created, the Automobile class. This class of objects had doors, steering wheels, headlights, and other features. Now when an automobile rolls off the assembly line, an instance of the Automobile class has been created, not a new class of objects. A new class of objects would be created if someone developed an individual flying machine and named that class FlyingMachine. Instances of the FlyingMachine object would soon start rolling off the assembly line as well. Although we’ll touch on this concept in more detail shortly, it’s important to understand that a class simply describes how an object is made and works—a blueprint, if you will. Instances are what you create from that blueprint. In the end, both the blueprint and the resulting instance must be created.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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