To preface this my knowledge of AS3 is quite novice. As the thread titled reads, I'm trying to get an FLV to play through it's entireity and then loop back towards a specific frame and keep replaying from the point endlessly. After a lot of digging I found a video tutorial using AS3 that worked! Here's my situation now though, I cannot find the right code to insert to make the video loop back to the frame that I want. The FLV just stops and doesnt rewind at the end of the video. Here is my code so far:

Ultimately, the video needs to play all the way through only on the first load and then loop back to frame 319 and play toward the end and loop back again to frame 319 infinitely. I think I'm almost there, I just need some assistance with getting my code working appropriately. I done this before using "gotoAndPlay()" but the loop isnt seamless thus it yields a one second pause before looping back. I'm hoping using a Netstream function that this will be resolved. I would appreciate any help!

Hi again! The video's total duration is 16.282 seconds. However when it ends on the first run it needs to loop back to frame 318 (or whatever the quivalent that is in seconds). After it loops back to frame 318 it should play to the end again ( at 16.282 seconds) and then loop back to 318 ad infinitum.

I tried the ns.seek script using seconds instead of the frame #, the project is still freezing on the last frame of the video. I took a screenshot to give a visual of my timeline / actionscript window. Maybe it will be of some assistance. If need be I can post a .swf.

So, I implemented the track code as posted above. Still freezes at the final frame of the video. My output log doesn't post any new meta information besides the time length of the FLV video. Please advise if those two lines of code need to be adjusted/changed in anyway.

Okay, I downloaded the water.flv, i had no problems playing the video in the FLV video player (so no problems with the FLV itself). I then moved water.flv into my project directory. Upon moving the water video into the project directory I changed the actionscript lines "ns.seek(4);" and the "ns.play(filename);" as you suggested. The same issue happens, the video plays and freezes on the last frame. Here is my code again for reference:

var video:Video = new Video(1980, 1020);

addChild(video);

var nc:NetConnection = new NetConnection();

nc.connect(null);

var ns:NetStream = new NetStream(nc);

var meta:Object = new Object ();

meta.onMetaData = function (meta: Object)

{

trace(meta.duration);

}

ns.client = meta;

video.attachNetStream(ns);

ns.play("water.flv");

meta.onPlayStatus = function(obj:Object):void{

trace(obj.code);

if(obj.code=="NetStream.Play.Complete"){

trace("seek");

ns.seek(4);

}

}

I also decided to run a debug on the FLV video in flash, using the debug movie command and I received this bit of output:

Attempting to launch and connect to Player using URL /Users/mitchp*****/Desktop/ART/Art (DO NOT DELETE!)/Digital work/Views/View I/L2.swf

From reading this, and from what I can understand, it seems like it's having an issue with file system / access permissions. I think this debug log is pointing to the possible culprit, and hopefully a solution can be made!

Thanks for sticking with me. Let me know if I can corroborate any more details.

Okay this did the trick! Just one detail that makes all the differenence. Fortunately there is no 1 second pause in the loop which is perfect, however there is a glitch, and I don't know if this is just the nature of the program or it's exsisting in some form of as3 syntax. I've provided a link for reference:

I determined the exact time it needs to hit for it to be a perfect palindrome loop, I programmed it to loop back to (frame 319) in seconds that is 10.6106, so in theory it should be looping seamlessly. However it's glitching, and I've toyed around with the timecode in the "ns.seek" line, but it seems nearly impossible due to the fact that I can get so damn infinitesimal with those numbers. Here is the code for further reference:

The previous method before using this netstream approach was importing the FLV and extending all the frames of it in the time-line and using the "gotoAndPlay" function, this didn't work because the loop wasnt seamless, there was an annoying 1 second pause before it looped back to the frame I wanted. (see my first post)

The as3 code I'm using now is just calling up the .flv video from the folder the .FLA project file is located in, it's pure code at this point. See post 7 for a screenshot of my project area.

Kgald - The frames are not extended, please refer to post 7 with my screenshot. In my project there is only one layer with a frame containing the action-script 3 we've been working with the entire time. Concerning the "16.2". I changed it to 16 but to no avail, the video still freezes on the last frame, here is the code:

The video has the same situation as exhibited in post 21, it gets to the last frame, loops, but it cannot exactly land on the correct time position so the loop can be smooth. There doesn't seem to be a delay/pause upon the rewind position.