Hi
I have a php file (current_mp3.php) that prints:
&mp3url=http://www.url.com/mp3.mp3
Which I believe is the right format to pass the variable in.
My AS looks like this:
var myData = new LoadVars();
myData.load("http://www.url.com/path/to/current_mp3.php");
var music:Sound = new Sound(new URLRequest("myData.mp3url"));
var sc:SoundChannel;
var isPlaying:Boolean = false;
var pos:Number = 0;
now_playing.visible=false;
paused.visible=false;
start.visible=true;
pause_btn.addEventListener(MouseEvent.CLICK, pauseMusic);
function pauseMusic(e:Event):void
{
if (isPlaying)
{
pos = sc.position;
sc.stop();
isPlaying = false;
now_playing.visible=false;
paused.visible=true;
start.visible=false;
}
}
play_btn.addEventListener(MouseEvent.CLICK, playMusic);
function playMusic(e:Event):void
{
if (!isPlaying)
{
sc = music.play(pos);
isPlaying = true;
now_playing.visible=true;
paused.visible=false;
start.visible=false;
}
}
…but it doesn’t seem to be working. I’m not sure what’s going on (I’m not experienced with AS). Any help very much appreciated!!