I need to load different sound files dependent on which link you previously clicked in my app, but cannot figure out how to call the link to the sound file from my mxl file:
<carRace>http://www.unisux.org/zik-car/lamborghini-diablo-gtr_standing-start.mp 3</carRace>
Can someone tell me what I am doing wrong in this code?
<fx:Script>
<![CDATA[
privatevar req:URLRequest;
privatevar context:SoundLoaderContext = new SoundLoaderContext(1000);
privatevar bCall:Sound;
privatevar bSong:Sound;
privatefunction playSong():void
{
var urlSong:String = "{carRace}";
var request:URLRequest = new URLRequest(urlSong);
bSong = new Sound(request, context);
bSong.play();
}
]]>
</fx:Script>
because this code does work:
<fx:Script>
<![CDATA[
privatevar req:URLRequest;
privatevar context:SoundLoaderContext = new SoundLoaderContext(1000);
privatevar bCall:Sound;
privatevar bSong:Sound;
privatefunction playSong():void
{
var urlSong:String = "http://www.unisux.org/zik-car/lamborghini-diablo-gtr_standing-start.mp 3";
var request:URLRequest = new URLRequest(urlSong);
bSong = new Sound(request, context);
bSong.play();
}
]]>
</fx:Script>