
6
Scripts
Scripts
•
•
Behavior script
Behavior script
–
–
functions associated with a
functions associated with a
specific sprite.
specific sprite.
•
•
Frame script
Frame script
–
–
functions associated with a
functions associated with a
specific frame.
specific frame.
•
•
Cast script
Cast script
–
–
functions associated with a specific
functions associated with a specific
cast member. These are executed by all sprites
cast member. These are executed by all sprites
created from that member.
created from that member.
•
•
Movie script
Movie script
–
–
global functions.
global functions.
•
•
Parent script
Parent script
–
–
used for
used for
’’
’’
object oriented
object oriented
’’
’’
programming.
programming.
Navigation and frame scripts
Navigation and frame scripts
All Director scripts use an event-listener programming model.
In frame scripts, the exitFrame event is called when the frame
is finished and Director is about to move to the next frame.
We can ’’freeze’’ at a particular frame by jumping back to itself.
Right-click in the script channel and choose Frame Script... to create
a new frame script for that frame.
Note that the script also appears as a cast member.
Re-compile all scripts by clicking the compile ( ) button.
Comentários a estes Manuais