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

Chapter 6. Customizing Objects > ENHANCING EXISTING OBJECT METHODS

ENHANCING EXISTING OBJECT METHODS

Flash’s built-in object classes (MovieClip, TextField, XML, and so on) come with a number of predefined methods that are useful in most situations. You may at times, however, need more functionality than they can provide. Using what you’ve learned thus far in this lesson, you can easily extend and enhance these methods to do just about anything imaginable.

You can enhance existing methods in two ways, depending on the type of object you’re working with. There are some objects you cannot create instances of: These are singular and universal to your project, and include the Mouse, Key, Selection, and Math objects. You cannot, for example, create an instance of the Mouse object—it’s universal, meaning you use the methods of the Mouse object to control the singular mouse that appears on screen. This is in contrast to object classes, for which you can create instances (MovieClip, TextField, and so on). When you cannot create an instance of an object, you can enhance a method of that object, using syntax that resembles the following:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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