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

Chapter 12. Objects > Formal Rules of Objects

Formal Rules of Objects

Most of these concepts will appear familiar. For example, by now you know that objects have properties, which are basically just variables that contain data. Some properties have visual representations, such as a clip’s _alpha property. Although the value for this property can be ascertained (as in theClip._alpha) and changed (as in theClip._alpha=10), some properties can be ascertained only. The set of properties for any object type is specific to the object. For instance, only the Movie Clip object has an _alpha property. Other objects have other properties, but they’re all the same in that they contain values that can sometimes be modified.

In addition to having properties, objects can have methods, which are functions that are applied to unique instances of an object. Methods are processes, whereas properties are just static attributes. So far, this should be a review. The concept that’s a little bit new is that formal objects must be instantiated. In the case of clip instances (that is, Movie Clip objects), you can instantiate them by dragging them from the Library. After objects have been instantiated, they have their own unique set of properties and the potential to have methods, such as nextFrame(), applied to them individually. The formal objects require that you instantiate them using a constructor function. All constructor functions follow this pattern:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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