User Guide
528 Chapter 12: Methods
When the handler runs, the Message window displays the following:
[12, 34, 6, 10, 45]
You can perform this same operation may be done using bracket access to the list in the
following manner:
on enterFrame
set vNumbers = [12, 34, 6, 7, 45]
vnumbers[4] = 10
put vNumbers
end enterFrame
When the handler runs, the Message window displays the following:
[12, 34, 6, 10, 45]
See also
[ ] (bracket access)
setCallback()
Usage
-- Lingo syntax
spriteObjRef.setCallback(actionScriptObject, ASEventName, #LingoHandlerName, \
lingoScriptObject)
// JavaScript syntax
spriteObjRef.setCallback(actionScriptObject, ASEventName, #LingoHandlerName,
lingoScriptObject);
Description
Flash command; this command can be used as a sprite or a global method to define a Lingo
callback handler for a particular event generated by the specified object. When ActionScript
triggers the event in the object, that event is redirected to the given Lingo handler, including all
arguments that are passed with the event.
If the ActionScript object was originally created within a Flash sprite, use the
flashSpriteReference syntax. If the object was originally created globally, use the
global syntax.
Note: If you have not imported any Flash cast members, you must manually add the Flash Asset Xtra
to your movie’s Xtra list in order for global Flash commands to work correctly. You add Xtra
extensions to the Xtra list by choosing Modify > Movie > Xtras. For more information about managing
Xtra extensions for distributed movies, see the Using Director topics in the Director Help Panel.
Parameters
actionScriptObject
Required. Specifies the ActionScript object that contains the event
ASEventName.
ASEventName Required. Specifies the ActionScript event that occurs.
lingoHandlerName Required. Specifies the Lingo handler that handles the event ASEventName.
lingoScriptObject Required. Specifies the Lingo script object that contains the handler
lingoHandlerName.