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

Hour 16. Using Components > Task: Change the Homemade Property to Refer to the ...

Task: Change the Homemade Property to Refer to the Parent

Now you'll put finishing touches on your Component in the making. Follow these steps:

1.
The preceding long explanation comes down to simply changing the Action in the enterFrame script on the Circle instance to _x=_x+_parent.speed. Go ahead and do so; then test the movie.

2.
Okay! It works. Now, you can make this clip a Component so that you can use the Parameters tab of the Properties panel and get rid of that funky Action in your first frame (of the main timeline). Consider all the extra work that Action requires. For example, you had to remember to name your instance of Clip containing Circle Clip (otherwise, you couldn't change the “speed” property directly). Also, every instance has to be named uniquely, and then every instance has to have its “speed” initialized in the first frame. Instead, you can make it so that the author using this Component can set each instance's speed via the Parameters tab (or Component Parameters panel).

3.
To make a Movie Clip become a Component, you simply have to specify which parameters (properties) you intend to let the using author change. Just open your Library window, select Clip containing Circle Clip, and from the Library's Options menu, select Component Definition. You'll see a dialog box like the one shown in Figure 16.9. After you establish the properties the author may edit, this clip becomes a Component.

Figure 16.9. Selecting a Movie Clip in the Library and choosing Component Definition from the Options menu displays this dialog box. After you establish the properties the author may edit, this clip becomes a Component.


4.
All you need to do for this task is to make “speed” a parameter the using author may edit. Click the plus button and then double-click varName (the default name for the variable you just inserted). Change this to speed. You can change DefaultValue to 10. Also, be sure to change the “Type” to Number. Click the OK button when you're finished.

5.
Get rid of the Action in frame 1 (select frame 1, access the Actions panel, and delete the entire script). Drag several instances of Clip containing Circle Clip on the Stage. For each one, use the Properties panel's Parameters tab to change each instance's “speed” to a different number. Run the Test Movie command. You've just created a Component!


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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