This is really
I want to load the sound from a different server then the one where my mp3 player is.I had a problem with my scrubber that didn't wanted to play from the position I entered after releasing the scrubber:
var pausedPosition:int = channel.position;
channel.stop();
channel = sound.play(pausedPosition);
After two days of trying "everything" with my player I decided to test the code from
http://livedocs.adobe.com/flash/9.0/...ndChannel.html
(the example below stop() method)
I wrote this code:
ActionScript Code:
var snd:Sound = new Sound();
var channel:SoundChannel = new SoundChannel();
var button:TextField = new TextField();
var req:URLRequest = new URLRequest("http://www.kafanasokace.co.yu/srpski/Kod Ovako Divne Noci.mp3");//this is the sound I want to load
snd.load(req);
button.x = 10;
button.y = 10;
button.text = "PLAY";
button.border = true;
button.background = true;
button.selectable = false;
button.autoSize = TextFieldAutoSize.CENTER;
button.addEventListener(MouseEvent.CLICK, clickHandler);
this.addChild(button);
function clickHandler(e:MouseEvent):void
{
var pausePosition:int = channel.position;
if (button.text == "PLAY")
{
channel = snd.play(pausePosition);
button.text = "PAUSE";
}
else
{
channel.stop();
button.text = "PLAY";
}
}
...and uploaded the player to a different server.Here:
http://zi.freehostia.com/player/player.html
When I test the player from my local computer from within Flash CS3 play/pause button works fine but when I test it in above URL (in IE and Firefox) when I press 'play' after pressing 'pause' sound doesn't play from the last position.It plays from 1-2 seconds after the last position. According to this I can not build a precise scrubber and the scrubber even won't work.
I tried with uploading crossdomain.xml file in root of the site from where I want to load the sound file but it didn't help.
Can someone tell me what causes the problem I am having?
Thanks.