Flash CS3 Documentation |
|||
| Programming ActionScript 3.0 > Working with XML > Reading external XML documents | |||
You can use the URLLoader class to load XML data from a URL. To use the following code in your applications, replace the XML_URL value in the example with a valid URL:
var myXML:XML = new XML();
var XML_URL:String = "http://www.example.com/Sample3.xml";
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener("complete", xmlLoaded);
function xmlLoaded(event:Event):void
{
myXML = XML(myLoader.data);
trace("Data loaded.");
}
You can also use the XMLSocket class to set up an asynchronous XML socket connection with a server. For more information, see the ActionScript 3.0 Language and Components Reference.
Flash CS3
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00000132.html
Comments
RavenWorks said on May 27, 2007 at 2:10 PM : MotionMaker said on Jun 20, 2007 at 10:15 AM : MotionMaker said on Jun 20, 2007 at 10:24 AM :