Click to See Complete Forum and Search --> : Flash 9 loop streaming FLV


tarsus
01-31-2008, 01:50 PM
This has to be simple to accomplish, but I've searched all over the web and haven't found a solution. (Not even in several other forums.)

I'm using Flash 9. I have an FLVPlayback component in my movie, and ONLY this component. What I want is simply for the FLV that is streaming through this component to continue to loop.

One method I've come across suggested this ActionScript (the FLVPlayback instance is called myPlayback):

myPlayback.complete = function(eventObject:Object):Void {
this.play();
};

But this produces this error at compile, and the movie doesn't play:
1046: Type was not found or was not a compile-time constant: Void.

The Adobe livedoc on FLVPlayback.complete located at:
http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00003537.html
actually prescribes this method for using complete:

var listenerObject:Object = new Object();
listenerObject.complete = function(eventObject:Object):Void {
myPlayback.play();
};
myPlayback.addEventListener("complete", listenerObject);

This produces the exact same error.

Someone must know how to loop a streaming FLV! I'm lost! If I'm somehow asking this question the wrong way, or this has everyone stumped because these methods should work, or there's a common way to do this in Flash 8 but not 9 - anything! - please respond and let me know. So far I can't even get anyone to respond to the question.

tarsus
01-31-2008, 04:08 PM
I finally was able to figure out that this method works in ActionScript 2 but not 3.

Does anyone know how to do this in ActionScript 3?

tarsus
02-01-2008, 01:15 PM
If anyone is actually interested in this issue, here's the solution (received from a developer in another forum):

import fl.video.*;

function onFLVComplete(event:VideoEvent):void {
event.target.play();
}

myPlayback.addEventListener(VideoEvent.COMPLETE, onFLVComplete);

damonlee@mac.co
03-18-2008, 09:16 PM
Tarsus,

Thank God for persistant people like you. Your code helped me alot!

Thank you
Damon

jimted
08-20-2008, 08:25 PM
I have the below code, getting error 1046 on compile, I think it's AS2 code causing the issue

import mx.video.*;
my_FLVPlybk.contentPath = "my_video.flv";
var listenerObject:Object = new Object();
// listen for complete event; play new FLV
listenerObject.complete = function(eventObject:Object):Void {
_root.gotoAndPlay(1);
};
my_FLVPlybk.addEventListener("complete", listenerObject);
stop();

Any help much appreciated.