Help with loading sound externally in actionscript 2.0

Hey everyone,

Currently what I’m trying to do is for a play button to just play the first thing that is on my XML file. I have the XML file layed out like this and it is being loaded earlier in the actionscript file.

<song>
<loc>testaudio/fire.mp3</loc>
<songtitle>Fire</songtitle>
<artist>Jim</artist>
<album>Album #1</album>
<track>3</track>
<duration>4:41</duration>
</song>

In my framescript I have a function that runs when the play button is released. Here is my script for the button.

var mySound:Sound = new Sound();

playb.onRelease = function() {
// Define onLoad handler for sound which starts the sound once it has fully loaded.
mySound.onLoad = function(success){
if(success == true) {
mySound.start(position/1000);
}
}
// Load the sound.
mySound.loadSound(loc[0]);
};

The mySound.loadSound(loc[0]); is coming up with an unknown, and this is because the file path is not in quotes because it wants a URL, not a variable (loc[0] should be passing on the file path for the first song in the XML file). Is there some way to change the variable so that the loudSound() function reads the path correctly? It works fine when I just pop the file path in there instead of loc[0], so I was hoping things would be as easy as just swapping them :wink:

Thanks ahead of time for any help.