Friday, May 05, 2025

Looping an FLV

A common question regarding Flash Video is : "How do I loop a video?".

Here's the code:

ns.onStatus = function(info) {
if (info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
};

Enjoy!

12 Comments:

Blogger actnsrp.tMonk said...

Your code is nice. Thanks for that.

4:19 PM  
Anonymous Dries said...

Thank you very much!
I was looking for this whole after noon.

9:06 AM  
Blogger Lee said...

great! now where do i paste the code?

1:30 PM  
Blogger Tom Green said...

Lee you paste the code aft5er the ns.play() function.

4:39 PM  
Blogger Ronnie said...

Thanks for the code, but I am a total idiot when it comes to flash, it is all very new to me. I use Flash MX2004 and I upload FLV to photobucket and then a create a flash swf media display using the flv url to play in it. I do this so I can upload the small file size swf file to a gaming website profile that only allows 600kb upload. Doing it this way allows me to play a 5 to 10 minute or more if I wish video on my profile. So with all that said where do I put that code to make my flv video loop in my swf file?

12:26 AM  
OpenID Jon Reese said...

Thank you, but I'm with Lee. I have a simple Flash movie: a stage with a progressive-download flv in the middle and I want it to loop. Can you give me simple directions on how to do that? Thanks, you're a pro. :)

7:33 PM  
Anonymous Tom Green said...

Jon are you using Flash CS3?scoop1752

5:36 AM  
Anonymous Anonymous said...

Hi all...

How about this:

import video
Select the video component on stage
Open the actions panel
add the following code:

on (complete) {
this.autoRewind = true;
this.play();
}

2:36 AM  
Anonymous Anonymous said...

Hi all..

How about this:

Import video
Select the video component on stage
Open the actions panel
Put the following code:

on (complete) {
this.autoRewind = true;
this.play();
}

2:38 AM  
Anonymous markstockton said...

on (complete) {
this.autoRewind = true;
this.play();
}

maby i'm stupid but it took me an hour to find out i can only apply scripts to FLVs in actionscript 2.0 not 3.0, however, this worked :P

3:37 PM  
Anonymous Anonymous said...

on (complete) {
this.autoRewind = true;
this.play();
}

works for me... thanks!

9:20 AM  
Anonymous Anonymous said...

2 hours I have spent looking for this loop fix - thank you

1:44 PM  

Post a Comment

<< Home