0

How to load a .xml file with URLVariables using AS3

example: file
example.xml?varsHere

var loa:URLLoader = new URLLoader();
loa.addEventListener(Event.COMPLETE, gocom);
loa.addEventListener(IOErrorEvent.IO_ERROR, gotError);
loa.load(new URLRequest("example.xml"));


function gotError(event:IOErrorEvent):void{
    trace("INVALID");
}//  function gotError


function gocom(event:Event){

    var userxml:XML = new XML(loa.data);
    XML.ignoreProcessingInstructions = false;
    userxml = new XML(loa.data);

}


//   INVALID
PATurmel
  • 77
  • 1
  • 5
  • 1
    What exactly are you trying to accomplish here? Are you trying to specify _which_ xml file you want the application to load using URLVariables? Your post doesn't make much sense as you don't need to use URLVariables to load an XML file, it sounds like you're doing more work for a task that can already be done very easily. – Anil Aug 27 '14 at 19:38
  • Yeah, sounds like I'm going about it wrong but I wanted to know if this could work. – PATurmel Aug 27 '14 at 19:49
  • Almost anything can work if you know what you're trying to accomplish. ;) – Anil Aug 27 '14 at 19:50
  • See what the error is. trace(event.text); – C. Parcell Aug 29 '14 at 16:30

0 Answers0