Modifying Assigned Behaviors

   

If you want to make changes in the behaviors you've assigned to sprites and frames , the place to do it is the Behavior Inspector ( Figure 14.9 ). The Behavior Inspector permits you to change the order of behaviors assigned to a sprite or frame, change the parameters of an assigned behavior, delete one or more of the behaviors assigned to a sprite, and make other kinds of modifications. (As you'll see in the next section, you can also use it to create your own behaviors.)

Figure 14.9. The Behavior Inspector is shown fully here so you can see all its parts , but its middle section (the editing pane) is normally closed.

graphics/14fig09.jpg

Note: The Behavior tab of the Property Inspector contains the same toolbar as the Behavior Inspector ( Figure 14.10 ). Of the tasks in this section, all but the first two can be accomplished in the Property Inspector as well as the Behavior Inspector.

Figure 14.10. The Behavior tab of the Property Inspector has a toolbar identical to that in the Behavior Inspector.

graphics/14fig10.gif

To open the Behavior Inspector:

  • Choose Window > Inspectors > Behavior.

    or

    Click the Behavior Inspector button in the Sprite toolbar ( Figure 14.11 ).

    Figure 14.11. The Behavior Inspector button in the Sprite toolbar.

    graphics/14fig11.gif

    (If the Sprite toolbar isn't visible, you can open it by choosing View > Sprite Toolbar while the Score is the active window.)

    or

    Double-click a behavior in the Cast window.

To view the description of a behavior:

  1. Open the Behavior Inspector.

  2. In the Score, select a sprite or frame that has a behavior assigned to it.

    or

    Select a behavior in the Cast window.

    The name of the selected behavior (followed by its parameters) appears in the top pane of the Behavior Inspector. If you've selected a sprite that has more than one assigned behavior, their names appear as a list.

  3. If the Behavior Inspector contains a list of behaviors, select one from the list ( Figure 14.12 ).

    Figure 14.12. If the Behavior Inspector contains a list of behaviors, select one from the list to view its description.

    graphics/14fig12.gif

  4. Read the behavior's description in the description pane.

    All behaviors from the Library palette have a description. Behaviors created by you or other Director users may not.

To delete a behavior assigned to a sprite or frame:

  1. Open the Behavior Inspector.

  2. In the Score, select a sprite or frame that has a behavior assigned to it.

    One or more behaviors appear in the top pane of the Behavior Inspector.

  3. If the Behavior Inspector contains more than one behavior, select the one that you want to delete.

  4. Choose Remove Behavior from the Clear Behavior pop-up menu on the Behavior toolbar ( Figure 14.13 ).

    Figure 14.13. The Clear Behavior pop-up menu allows you to delete a single behavior or all behaviors.

    graphics/14fig13.gif

    or

    Press the Delete key.

To delete all behaviors assigned to a sprite or frame:

  1. Open the Behavior Inspector.

  2. In the Score, select a sprite or frame that has a behavior assigned to it.

    One or more behaviors appear in the top pane of the Behavior Inspector.

  3. Choose Remove All Behaviors from the Clear Behavior pop-up menu on the Behavior toolbar.

    or

    Choose Clear All Behaviors from the Behaviors pop-up menu on the Sprite toolbar ( Figure 14.14 ).

    Figure 14.14. To delete all behaviors assigned to a sprite or frame without having to open the Behavior Inspector, choose Clear All Behaviors from the Behaviors pop-up menu in the Sprite toolbar.

    graphics/14fig14.gif

    (If the Sprite toolbar isn't visible, you can open it by choosing View > Sprite Toolbar while the Score is the active window.)

To change the order of behaviors assigned to a sprite:

  1. Open the Behavior Inspector.

  2. In the Score, select a sprite that has more than one behavior assigned to it.

  3. Select a behavior from the list in the top pane of the Behavior Inspector.

  4. Use the Shuffle Up and Shuffle Down buttons at the top of the window to move the selected behavior up or down in the list ( Figure 14.15 ).

    Figure 14.15. The Shuffle Up and Shuffle Down buttons change the order of behaviors. Here, the Shuffle Down button is used to move the selected behavior down in the list.

    graphics/14fig15.jpg

  5. Repeat steps 3 and 4 if you want to change the position of other behaviors in the list.

To change the parameters of an assigned behavior:

  1. Open the Behavior Inspector.

  2. In the Score, select a sprite or frame that has a behavior assigned to it.

    One or more behaviors appear in the top pane of the Behavior Inspector.

  3. If the Behavior Inspector contains more than one behavior, select the one whose parameters you want to change.

  4. Click the Parameters button on the Behavior toolbar ( Figure 14.16 ).

    Figure 14.16. Click the Parameters button on the Behavior toolbar.

    graphics/14fig16.gif

    The Parameters dialog box appears, displaying the parameters you set when you first assigned the behavior.

  5. Change the parameters as desired.

  6. Click OK to close the dialog box.

To edit a behavior's Lingo script:

  1. Open the Behavior Inspector.

  2. In the Score, select a sprite or frame that has a behavior assigned to it.

    One or more behaviors appear in the top pane of the Behavior Inspector.

  3. If the Behavior Inspector contains more than one behavior, select the one whose script you want to change.

  4. Click the Script Window button on the Behavior toolbar ( Figure 14.17 ).

    Figure 14.17. Open a behavior's script by clicking the Script Window button on the Behavior toolbar.

    graphics/14fig17.gif

    The Script window opens, displaying the Lingo script that underlies the behavior ( Figure 14.18 ).

    Figure 14.18. The Script window, displaying a behavior's Lingo script.

    graphics/14fig18.gif

  5. Edit the script as desired.

    To accomplish this step, you must be familiar with Lingo. (The following chapter, "Scripting Lingo," will give you an introduction.)

  6. Close the Script window to make the changes take effect.

graphics/tick.gif Tip

  • The Cast window has a button called the Cast Member Script button, which is identical to the Script Window button on the Behavior toolbar ( Figure 14.19 ). It can be used to open the Script window for a behavior you've selected in the Cast window.

    Figure 14.19. The Cast Member Script button in the Cast window can be used to open the Script window for a selected cast member.

    graphics/14fig19.gif


   


Macromedia Director MX for Windows and Macintosh. Visual QuickStart Guide
Macromedia Director MX for Windows and Macintosh. Visual QuickStart Guide
ISBN: 1847193439
EAN: N/A
Year: 2003
Pages: 139

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net