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

Part I: Foundation > Homemade Objects

Chapter 13. Homemade Objects

Now that you’ve seen a variety of objects built-in to Flash, it’s time to make your own objects. You’ve actually already had to create homemade objects when you made so-called “generic objects” for the purposes of storing multiple values in named properties (similar to arrays, except that each item is named). The homemade objects that you’ll make in this chapter go beyond just storing data. They are almost identical to built-in objects such as the Movie Clip, Sound, or Date objects. The instances of homemade objects you create can have properties and methods.

In fact, homemade objects can be more sophisticated than those built-in to Flash because of a special feature called inheritance. After you design and build one object, it’s possible to design new objects that share certain properties and methods of that object. For example, you could make a “Bank Account” object that includes a method to calculate interest. That same method can be inherited by another object (perhaps a “Certificate of Deposit” object). By using inheritance, you can modularize code to increase your productivity.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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