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

Chapter 11. Working with Movie Clips > Initializing class properties

Initializing class properties

In the example presented in the second procedure under “Assigning a class to a movie clip symbol”, you added the instance of the Ball symbol to the Stage while authoring. As discussed in “Adding parameters to dynamically created movie clips” on page 370, you can assign parameters to clips you create at runtime by using the initObject parameter of attachMovie() and duplicateMovie(). You can use this feature to initialize properties of the class you’re assigning to a movie clip.

For example, the following class named MoveRightDistance is a variation of the MoveRight class (see “Assigning a class to a movie clip symbol” on page 384). The difference is a new property named distance, whose value determines how many pixels a movie clip moves each time it is clicked.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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