Hi, I am trying to retrieve the contents of my XML file and use the variables later on in the script;
I have the following actionscript code
// Get XML Vars
var xml:XML;
var urlLoader = new URLLoader();
var songdataurl:String = '0';
urlLoader.addEventListener(Event.COMPLETE,onXMLLoaded);
urlLoader.load(new URLRequest("data.xml"));
function onXMLLoaded(e:Event):void{
xml = new XML(e.target.data);
GetSongData();
}
function GetSongData():void{
songdataurl = xml..song[0];
}
trace(songdataurl);
//Use songdataurl in script
and the following is the contents of data.xml
<?xml version="1.0" encoding="UTF-8"?>
<songs>
<song title="A Song" artist="Joe Blogs" album="An Album">/getsong/?ID=12345&Hash=12345678&IP=0.0.0.0</song>
</songs>
I'm trying to get the contents of the <song></song>
tag and use it later on in my script.
Thanx,
Sam