*blog... kind of... *rss
Loop a FLV in AS3 (and AS2)
7 commentsLots 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.
Simple and beautiful. Thanks once again Tweener! :D
Updated
However, the proper way to do that on AS3 is this one:
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);
}
thanks for the loop flv code.
February 15th 2009, joe
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.
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?
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?
*profile

traditional id: Ricardo Cabello Miguel
based in: London, UK
more: github, twitter, twitpic, soundcloud and flattr
*post nav
PV3D 2.0: Real Materials
FWA's Site of The Day!
"This is not a PC, this is a MAC"
PV3D 2.0: How to render in anaglyphic (stereo) mode
PV3D 2.0: How to do simple realtime shadows
Loop a FLV in AS3 (and AS2)
mrdoob.com v3
Google wrecked the internet
87eleven
Using your Wii as Mediaplayer
Turkish Rambo