So if you use this class, you just need to instatiate an object and call the file/webservice. Instantiate a new object for each file/webservice.
This code was copied from the website: http://www.mediareason.com/blog/?p=20
package com.func { import flash.net.URLLoader import flash.net.URLRequest import flash.xml.XMLDocument; import flash.errors.* import flash.events.* public class LoadXML { private var loader : URLLoader; private var mainXML : XML; public function LoadXML() { loader = new URLLoader(); loader.addEventListener(Event.COMPLETE, onComplete); loader.load(new URLRequest("http://.../test.xml")); } private function onComplete(evt:Event) { try { mainXML = new XML(loader.data) trace(mainXML); } catch(e:Error) { trace("Error: " + e.message) return; } } } }
No comments:
Post a Comment