Pass query to flash player for mp3 file

I have been working on this part for a couple of days, being new to as3, it’s taking me alot longer than it would take someone who knew what they were doing.

I have a member based website, they can upload mp3 files that go into their own folder, I have code in the upload script that automatically creates and updates the xml file in their folder.

I use flashvars to pass the xml info to the player, but it still isn’t playing the mp3 files because the player’s actionscript songURL is pointing to a static directory, I need it to point to the folder of the member profile being viewed at that moment.

I have the html for the xml file as follows:

<param name="movie" value="flplayer1a.swf">
                    <embed src="flplayer1a.swf" FlashVars="xml=<?php echo "members/$id/playlist.xml" ?>"></embed>
                    <param name="FlashVars" value="xml=<?php echo "members/$id/playlist.xml" ?>">

so now I need the songURL to do the same thing, but to read the mp3, the line in the as3 script is as follows:

songURL = new URLRequest("mp3_files" + firstSong + ".mp3");

the code makes another reference to this for the song switching.

so how can I pass the members/$id query into the player for the mp3, can I add a second value in the flashvars? and if so what do I do with the songURL code?

NOTE: This is a prebuilt flash mp3 player I downloaded

I solved the problem, I will post my resolution here for anyone interested in achieving the same thing.

first, to load the xml into the flash player from a php $id variable, I put this in my object tags in my html code:

 <param name="movie" value="flplayer1a.swf">
                    <embed src="flplayer1a.swf" FlashVars="xml=<?php echo "members/$id/playlist.xml" ?>"></embed>
                    <param name="FlashVars" value="xml=<?php echo "members/$id/playlist.xml" ?>">

then to have flash read the document, I put this in the ac3:

var myXML:XML = new XML();
var XML_URL:String = loaderInfo.parameters.xml;
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);

then to get the player to read the mp3 file, I use the var split

var memberPath:String;
var ulrSplit:Array = loaderInfo.parameters.xml.split("/");
// remove last element - xml file name
ulrSplit.pop();
// join back / - it is the path to member directory
memberPath = ulrSplit.join("/") + "/";

and then in the song url I put this

songURL = new URLRequest(memberPath + firstSong +".mp3");

thanks to Andrei1 over at the Adobe forums for his help, it was quite valuable.