I've searched averywhere, but can't find an answer that specifically applies to me. I have a AS3 array that is currentely populated manually inside the script and the rest of the code that does something with this array. How can I 'convert' this array to populate using XML without affecting the rest of the code. Code:
var my_info_array:Array = new Array("Info-pdf.swf", "Info2-pdf.swf");
//This first line I want to populate using XML without affecting the code below
var infoURLnow:Number = 0;
var myTimer2:Timer = new Timer(5000);
myTimer2.addEventListener(TimerEvent.TIMER, timerListener);
function timerListener (e:TimerEvent):void{
if(infoURLnow != totalInfo) {
loadINFO();
}
else {
infoURLnow = 0;
loadINFO();
}
}
myTimer2.start();
loadINFO();
function loadINFO(){
var infoLoader:Loader = new Loader();
var infoURL:String = my_info_array[infoURLnow];
var infourl:URLRequest = new URLRequest(infoURL);
infoLoader.load(infourl);
info_kozel.addChild(infoLoader);
infoLoader.x = 20;
infoLoader.y = 20;
infoLoader.scaleX = infoLoader.scaleY =1.25;
infoURLnow = infoURLnow +1;
}
Something like this:
var data:XML = new XML();
var xml_Loader:URLLoader = new URLLoader();
xml_Loader.load(new URLRequest("Info.xml"));
xml_Loader.addEventListener(Event.COMPLETE, do_XML);
Then how do I integrate the above code into do_XML function??