Hi All,

I am trying to preload an external MP3 without playback starting
immediately. The reason I am doing this is because I am allowing the
EU to resume a previous media playback session and I want to start
playback at a predetermined position. I have found that if I call
sound.play( position ) before the song is loaded errors are thrown, so
now I added code to my sounds Event.Complete listener function to
initiate playback at the specified position but, the sound starts
playing as soon as it is loaded and I hear a couple seconds from the
beginning of the song before the Complete event is dispatched and I
call sound.play(position).

>From the Sound API doc's what I need is to just load the song and once
loaded start playback at the position with the following code, but it
is not working:

sound = new Sound();
sound.addEventListener( Event.COMPLETE, onSongLoaded );
sound.load( new URLRequest( mediaSource.href  ) );

function onSongLoaded(event:Event):void
{
    sound.play(someposition);
}

How can I preload the song without playback starting at the begining
of the song as soon as loading completes?

Any help much appreciated.

Greg

Reply via email to