User Guide

Chapter 366
alert
Syntax
alert message
Description
Command; causes a system beep and displays an alert dialog box containing the string specified
by message and an OK button. This command is useful for providing error messages of up to
255 characters in your movie.
The message must be a string. If you want to include a number variable in an alert, use the
string function to convert the variable to a string.
Examples
The following statement produces an alert stating that there is no CD-ROM drive connected:
alert "There is no CD-ROM drive connected."
This statement produces an alert stating that a file was not found:
alert "The file" && QUOTE & filename & QUOTE && "was not found."
See also
string(), alertHook
alertHook
Syntax
the alertHook
Description
System property; specifies a parent script that contains the on alertHook handler. Use
alertHook to control the display of alerts about file errors or Lingo script errors. When an error
occurs and a parent script is assigned to
alertHook, Director runs the on alertHook handler in
the parent script.
Although it is possible to place
on alertHook handlers in movie scripts, it is strongly
recommended that you place an on alertHook handler in a behavior or parent script to avoid
unintentionally calling the handler from a wide variety of locations and creating confusion about
where the error occurred.
Because the
on alertHook handler runs when an error occurs, avoid using the on alertHook
handler for Lingo that isn’t involved in handling an error. For example, the
on alertHook
handler is a bad location for a
go to movie statement.
The
on alertHook handler is passed an instance argument, two string arguments that describe
the error, and an optional argument specifying an additional event that invokes the handler.