User Guide
setCollisionCallback() 529
Example
This statement sets a the Lingo handler named myOnStatus in the Lingo script object me to be
called when an
onStatus event is generated by the ActionScript object tLocalConObject in the
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(), clearAsObjects()
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
whichModel is involved in a collision.
This command works only if the model’s collision.enabled property is TRUE. The default
behavior is determined by the value of
collision.resolve, you can override it using the
collision.resolveA and/or the collision.resolveB commands. Do not use the
updateStage command in the specified handler.