« PV3D 2.0: How to do... mrdoob.com v3 »

Loop a FLV in AS3 (and AS2)

Dec 6th, 2007

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);
}


#permalink

Share:
Digg! ~ del.icio.us ~ Stumble ~ Furl ~ Reddit
Webs / Print / Logos... everything I do will be listed here.



If you're looking for my Actionscript experiments, here you have: