User Guide
571
ADOBE GOLIVE CS2
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);
deb u sS tr in g (t h e Res 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 (val u e1 + val u e2);
}
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.
Text tracks You can combine onMouseDown, onMouseUp, onMouseClick, onMouseEnter, and onMouseExit
eventhandlers in one script file. OnIdle, onListReceived, onKey, and onMouseMoved each require a separate script.
Movie Tracks Only onMovieLoaded is allowed as an event handler.
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 Flashtrackscan useonlymovie variables. When youadd ascripttothese typesoftracks, 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 Global variables are only allowed for sprite tracks. They can be accessed by all sprites on a track.
Global variables must have the prefix “g_”.
Sprite variables Sprite variables, while allowed only for sprites, are accessible from different eventhandlers. Sprite
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.










