194
Chapter 10: Events and Messages
on sendXML
Usage
-- Lingo syntax
on sendXML
"sendxmlstring", "window", "postdata"
statement(s)
end
// JavaScript syntax
function sendXML(
sendxmlstring, window, postdata
) {
statement(s);
}
Description
Event handler; functions much like the
getURL
scripting method, which is also available using the
Macromedia Flash Asset Xtra extension. 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 extension handles these functions in the same way as Flash 5 or Flash MX content 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:
-- Lingo syntax
on sendXML me, theURL, targetWindow, xmlData
gotoNetPage(theURL, targetWindow)
postNetText(theURL, xmlData)
end
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...