*blog... kind of... *rss 



Loop a FLV in AS3 (and AS2)
Lots of people always ask stuff like that (me the first), and after a while without having to deal with video on flash, I had to do it today and a very easy solution popped out.

function onFLVMetaData( metadata:Object ) :void
{
Tweener.addTween( this, { time: metadata.duration, onComplete: restartVideo } );
}

Simple and beautiful. Thanks once again Tweener! :D

Updated
However, the proper way to do that on AS3 is this one:

function netStatusHandler( event:NetStatusEvent ) :void
{
if(event.info.code == "NetStream.Play.Stop")
stream.seek(0); }
7 comments

thanks for the loop flv code.
u = lifesaver
That's just what I was after, thank you.
Hi this looks great but do I also need to create an EventListener for the netStatusHandler function? And what would need to listen for this event?
I don't remember which one dispatched that event, but yeah, you need this:

connection = new NetConnection();
connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
connection.connect( null );

stream = new NetStream( connection );
stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
video.attachNetStream( stream );

Hope this helps.
thanks...i was looking for this...
hi, im new with AS3 and also with flash,
just one quiestion, i recieve a message that says that the attachNetStream method is nos valid or so..
i dont know haw to solve it
any suggestions?