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

Chapter 17. Unlocking the Power of Movie... > Using Init Objects to Give Propertie...

Using Init Objects to Give Properties to New Movie Clips

Both the attachMovie() and duplicateMovieClip() methods of the MovieClip class allow you to specify an init object when creating a movie clip. Flash automatically gives the new clip all the local properties of the init object. This feature is an advantage of the duplicateMovieClip() method over the duplicateMovieClip() global function.

In the following example, myClip is the clip you’re attaching to, linkageID is the linkage ID of a clip in the Library, newInstance is the name of the new clip, 1 is the depth of the new clip, and initObj is the name of an object:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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