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

Summary

We’ve looked at three traditional objects made for Flash: Sound, Color, and Date. In each of these, you first need to create an instance of the object (by putting it in a variable), and then you can use any of the object’s methods. The three objects introduced in this chapter are a good representation of “formal” objects. So many other objects in Flash have special conditions that let you get away without instantiating them (the Math and String objects, in particular). In addition to Sound, Color, and Date, you saw three ways to instantiate Movie Clips at runtime: (attachMovie(), duplicateMovieClip(), and createEmptyMovieClip()). The important thing to remember when attaching or creating clips is that the master symbol needs to have its linkage set (as does a sound when using the Sound object). On top of all that, you got to play with Flash MX’s new drawing methods.

Another key concept you should take away from this chapter is the way a generic object can be populated with values for several named properties and then passed as a parameter. You even saw how a special constructor function can produce such generic objects and even set initial properties. The main thing we did was to populate a variable with values. Both the Sound and Color object’s setTransform() method requires a generic object with specific properties. (That is, the named properties need to match the arbitrary names designated in Flash’s design.) The same basic technique was used in the drawing methods, although often the properties themselves contained multiple values in the form of arrays. We’ll fully explore the process of creating generic objects in Chapter 13 when we create our own custom objects that do more than just store data.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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