This is what I do:
Code:
myNetconnection = new NetConnection();
myNetconnection.connect(null);
myStream = new NetStream(myNetconnection);
myStream.setBufferTime(3);
my_video.attachVideo(myStream);
myStream.play(my.flv);
Code:
myStream.onStatus = function(info)
{
trace("info="+info.code);
if (info.code == "NetStream.Play.Stop")
{
// Set flag, we will need to wait for
// "NetStream.Buffer.Empty" before
// actually restarting the movie.
stopped=true;
}
if (info.code == "NetStream.Buffer.Empty")
{
// At this point, the movie has stopped, and
// the buffer is empty.
// We're ready to restart the movie.
if (stopped)
{
myStream.seek(0)
myStream.play(my.flv);
stopped=false;
}
}
}