# Variable from XML into Flash

**URL:** <https://forum.kirupa.com/t/variable-from-xml-into-flash/110841>\
**Category:** Uncategorized\
**Created:** [May 20, 2004, 11:00am UTC](https://forum.kirupa.com/t/variable-from-xml-into-flash/110841 "2004-05-20T11:00:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blairmillen](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@blairmillen](https://forum.kirupa.com/u/blairmillen)\
**Post date:** [May 20, 2004, 11:00am UTC](https://forum.kirupa.com/t/variable-from-xml-into-flash/110841/1 "2004-05-20T11:00:49Z")

</div>

Hi all,

I’m trying to create a flash music player. A user clicks a link and an on-the-fly XML document is created using PHP. I’m want to send the XML doc to the flash file. Looking at the [size=2]**[font=Verdana][color=#003366]XML[/color][/font]**[/size][font=Verdana][size=4][color=#003366][size=2] to and from Flash[/size] [color=black][size=2]article, I understand how to load the XML file, but my problem is how to take the contents of that file and convert it into an Action Script variable, so I can pass it to my load line of code (I don’t have it available right now, sorry, I’m at my work).

My current script simply plays the track from a url I hard code into the flash file.

With reference to the above mentioned article, I have this code:

[/size][/color][/color][/size][/font][size=2][font=Courier New][color=#000088]my\_xml = new XML();  
my\_xml.onLoad = function(success){  
if (success){  
trace(this.toString());  
}else{  
trace(“There was an Error in loading the XML document”);  
}  
}  
my\_xml.load(“info.xml”);

[color=black]So, I’ve loaded my XML file, which contains something like [http://mydomain.com/music/file.mp3](http://mydomain.com/music/file.mp3), how do I pass on this as a variable?

Hope this is clear enough so someone can help :o)  
[/color][/color][/font][/size]
