Lingo Dictionary > S > script |
![]() ![]() ![]() |
script
Syntax
the script of menuItem
whichItem
of menu
whichMenu
childObject
.script
the script of
childObject
Description
Menu item and child object property.
For menu items, determines which Lingo statement is executed when the specified menu item is selected. The whichItem
expression can be either a menu item name or a menu item number; the whichMenu
expression can be either a menu name or a menu number.
When a menu is installed, the script is set to the text following the "Å" character in the menu definition.
This property can be tested and set.
Note: Menus are not available in Shockwave.
For child objects, the return value is the name of the child's parent script. This property can be tested but not set.
To see an example of script
used in a completed movie, see the Parent Scripts movie in the Learning\Lingo Examples folder inside the Director application folder.
Example
This statement makes goHandler
the handler that is executed when the user chooses the Go command from the custom menu Control:
set the script of menuItem "Go" of menu "Control" to "goHandler"
Example
This Lingo checks whether a child object is an instance of the parent script Warrior Ant:
if bugObject.script = script("Warrior Ant") then bugObject.attack()
end if
See also
checkMark
, installMenu
, menu, handlers(), scriptText
![]() ![]() ![]() |