Example
This statement sets a the Lingo handler named
called when an
onStatus
Flash movie in sprite 3:
-- Lingo syntax
sprite(3).setCallback(tLocalConObject, "onStatus", #myOnStatus, me)
// JavaScript syntax
sprite(3).setCallback(tLocalConObject, "onStatus", symbol("myOnStatus"), me);
The following statements create a new global XML object and create a callback handler that
parses XML data when it arrives. The third line loads an XML file. The callback handler is
included as well.
-- Lingo syntax
gXMLCB = newObject("XML")
setCallback( gXMLCB, "onData", #dataFound, 0 )
gXMLCB.load( "myfile.xml")
-- Callback handler invoked when xml data arrives
on dataFound me, obj, source
obj.parseXML(source)
obj.loaded = 1
obj.onload(TRUE)
end dataFound
// JavaScript syntax
gXMLCB = newObject("XML");
setCallback( gXMLCB, "onData", symbol("dataFound"), 0 );
gXMLCB.load( "myfile.xml" );
// Callback handler invoked when xml data arrives
function dataFound(me, obj, source) {
obj.parseXML(source);
obj.loaded = 1;
obj.onload(1);
}
See also
newObject(),
setCollisionCallback()
Usage
member(whichCastmember).model(whichModel).collision.\
setCollisionCallback (#handlerName, scriptInstance)
Description
3D collision command; registers a specified handler, in a given script instance, to be called when
is involved in a collision.
whichModel
This command works only if the model's
behavior is determined by the value of
collision.resolveA
command in the specified handler.
updateStage
event is generated by the ActionScript object
clearAsObjects()
and/or the
collision.resolveB
in the Lingo script object
myOnStatus
collision.enabled
, you can override it using the
collision.resolve
commands
tLocalConObject
property is
. The default
TRUE
Do not use the
.
setCollisionCallback()
to be
me
in the
529
Need help?
Do you have a question about the DIRECTOR MX 2004-DIRECTOR SCRIPTING and is the answer not in the manual?
Questions and answers