Adobe GOLIVE CS2 User Manual page 580

Hide thumbs Also See for GOLIVE CS2:
Table of Contents

Advertisement

ADOBE GOLIVE CS2
571
User Guide
Custom functions in QuickTime scripts
QuickTime Wired Action Programming Language lets you create true custom functions, complete with custom
arguments and result values. For example, the following uses a custom function called "my Add Func" to add two
values and return the sum:
f u nc tio n o n M o us eDo w n ()
{
va r t h eRes u l t = m y Ad dF unc (10 + 20);
d e b u s S t r i n g ( t h e R e s u l t ) ;
}
f u nc tio n my Ad dFun c (va l u e1, va l u e2)
{
r e t u r n ( v a l u e 1 + v a l u e 2 ) ;
}
Combining eventhandler actions in one script
You can combine multiple eventhandler scripts into one script file, depending on the track type.
Note: When you use an eventhandler in a script, do not use the matching predefined action, as it will be overwritten by
the eventhandler in the script.
Sprite tracks
You can combine onIdle, onListReceived, onKey, onMouseMoved, onMouseDown, onMouseUp,
onMouseClick, onMouseEnter, and onMouseExit eventhandlers in one script. OnFrameLoaded requires a separate
script file.
You can combine onMouseDown, onMouseUp, onMouseClick, onMouseEnter, and onMouseExit
Text tracks
eventhandlers in one script file. OnIdle, onListReceived, onKey, and onMouseMoved each require a separate script.
Only onMovieLoaded is allowed as an event handler.
Movie Tracks
SWF tracks
You can combine onMouseDown, onMouseUp, onMouseClick, onMouseEnter, and onMouseExit.
Variable scopes
QuickTime supports variable scopes, which indicate where and when a variable can be used within a movie. There
are four variable scopes.
Note: Text, movie, and Flash tracks can use only movie variables. When you add a script to these types of tracks, GoLive
generates the required movie variables automatically.
Movie variables
Movie variables are accessible from all scripts and objects for the length of the movie. Movie
variables must have the prefix "m_". For example,
"var m_Counter = 10;"
defines a movie variable.
Global variables are only allowed for sprite tracks. They can be accessed by all sprites on a track.
Global variables
Global variables must have the prefix "g_".
Sprite variables, while allowed only for sprites, are accessible from different eventhandlers. Sprite
Sprite variables
variables must have the prefix "s_".
Local variables
Local variables are only allowed for sprites and sprite track actions. They do not require a prefix.

Advertisement

Table of Contents
loading

Table of Contents