Chapter 16
388
To keep the playhead in a single frame:
•
In a frame behavior, type the following statement on the line after the
on exitFrame
statement:
go to the frame
The Lingo expression “the frame” always refers to the frame currently occupied by the playhead.
This statement essentially tells the playhead to “go back to the frame you are currently in”.
To create a sprite behavior (script attached to a sprite):
•
In the Score or on the Stage, select the sprite that you’re attaching the behavior to. Then select
Window > Behavior Inspector and select New Behavior from the Behavior pop-up menu.
When you create a new sprite behavior, the Script window opens and already contains the line
on
mouseUp
, followed by a line with a blinking insertion point, and then a line with the word
end
.
This makes it easy for you to quickly attach a common behavior to the sprite.
To open a behavior for editing:
1
Double-click the behavior in the Cast window.
The Behavior inspector opens.
2
Click the Script Window icon in the Behavior inspector.
The Script window displays the behavior.
Alternatively, you can open the Script window and cycle through the scripts until you reach
the behavior.
To remove a behavior from a Score location:
•
Select the location and then delete the script from the list displayed in the Property inspector
(Behavior tab).
To attach existing behaviors to sprites or frames, do one of the following:
•
Drag a behavior from a cast to a sprite or frame in the Score or (for sprites) to a sprite on
the Stage.
•
In the score, select the sprites or frames that you’re attaching the behavior to. Then
select Window > Behavior Inspector and select the existing behavior from the Behavior
pop-up menu.
To create a movie script (script attached to a movie), do one of the following:
•
If the current script in the Script window is a movie script, click the New Script button in the
Script window. (Clicking the New Script button always creates a script of the same type as the
current script.)
•
If the current script in the Script window is not a movie script, click the New Script button
and then change the new script’s type with the Script Type pop-up menu in the Script tab of
the Property inspector.
•
If no sprites or scripts are selected in the cast, Score, or Stage, then open a new Script window;
this will create a new movie script by default.
Содержание DIRECTOR MX-USING DIRECTOR MX
Страница 1: ...Using Director MX Macromedia Director MX...
Страница 12: ...Contents 12...
Страница 156: ...Chapter 4 156...
Страница 202: ...Chapter 6 202...
Страница 244: ...Chapter 7 244...
Страница 292: ...Chapter 10 292...
Страница 330: ...Chapter 12 330...
Страница 356: ...Chapter 13 356...
Страница 372: ...Chapter 14 372...
Страница 442: ...Chapter 16 442...
Страница 472: ...Chapter 18 472...
Страница 520: ...Chapter 19 520...
Страница 536: ...Chapter 20 536...
Страница 562: ...Chapter 23 562...
Страница 566: ...Chapter 24 566...
Страница 602: ...Chapter 27 602...