
587
Example
This handler sends the custom message
bumpCounter
and the argument
2
to sprite 1 when the user
clicks:
on mouseDown me
sendSprite (1, #bumpCounter, 2)
end
See also
sendAllSprites
on sendXML
Syntax
sendXML "sendxmlstring", "window", "postdata"
Description
Event handler; functions much like the
getURL
scripting method, which is also available using the
Flash Asset Xtra. The
on sendXML
handler is called in Lingo when the
XMLobject
.send
ActionScript
method is executed in a Flash sprite or Flash XML object.
In ActionScript, the
XMLobject
.send
method passes two parameters in addition to the XML data in
the XML object. These parameters are as follows:
•
url
—the URL to send the XML data to. Usually this is the URL of a server script that is
waiting to process the XML data.
•
window
—the browser window in which to display the server’s response data.
The ActionScript
XMLobject
.send
method can be called in Director either by a Flash sprite or by a
global Flash XML object created in Lingo. When this happens, the Lingo
on sendXML
handler is
called, and the same parameters are passed to the handler.
The following Lingo illustrates how the parameters are received by the
on sendXML
handler:
on sendXML me, theURL, targetWindow, XMLdata
These parameters correlate with the
XMLobject
.send
parameters as follows:
•
theURL
—the URL to send the XML data to.
•
targetWindow
—the browser window in which to display the server’s response.
•
XMLdata
—the XML data in the Flash XML object.
By creating an
on sendXML
handler in your Director movie, you enable it to process
XMLobject
.send
events generated in a Flash sprite or a global Flash object.
Flash sprites can also load external XML data or parse internal XML data. The Flash Asset Xtra
handles these functions in the same way as a Flash 5 or Flash MX movie in your browser.
Example
This Lingo command gets the
XMLobject
.send
method information from a Flash sprite and then
directs the browser to the URL and transmits the XML data to the URL:
on sendXML me, theURL, targetWindow, xmlData
gotoNetPage theURL, targetWindow
postNetText(theURL, xmlData)
end
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...