![MACROMEDIA FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT... Use Manual Download Page 86](http://html1.mh-extra.com/html/macromedia/flash-remoting-mx-using-flash-remoting-for-flash-mx-2004-actionscript/flash-remoting-mx-using-flash-remoting-for-flash-mx-2004-actionscript_use-manual_3385355086.webp)
86
Chapter 4: Using Flash Remoting Data in ActionScript
// Function that runs when the user clicks a "Test XML" button after
// entering text in two text boxes. Handles a return message sent by
// the server:
function testDocument(){
// Create the XML document.
var xmlDocument:XML = new XML();
var firstElement:XMLNode = xmlDocument.createElement("test");
firstElement.attributes.message = input1_txt.text;
var secondElement:XMLNode = xmlDocument.createElement("insidetest");
secondElement.attributes.message = input2_txt.text;
firstElement.appendChild(secondElement);
xmlDocument.appendChild(firstElement);
// Call the service function and pass it the XML document
trace(xmlDocument);
}
// Result Handler to handle the results returned by the Remoting call
function testDocument_Result(result){
// Result is an XML object
// For this example, get an attribute from the first node
output_txt.text = result.firstchild.attributes["message"] +
result.firstchild.firstchild.attributes["message"];
}
Note:
Because the Flash XML object is a standard Flash object and not part of Flash Remoting, this
document does not cover the details of using XML objects in Flash. For more information on using
the Flash XML objects, see Flash Help.