PDA

View Full Version : Dual FVLPlayBack freezes


razovy
09-08-2006, 06:31 PM
I need 2 FVLPlayBack-s for constant playing same clips over and over again.

So I agged 2 FVLPlayBack onto the Scene 1, and added the following code to my Actions Layer 2:
//==============
import mx.video.FLVPlayback;
import mx.video.*;
import mx.controls.Button;
import mx.controls.Menu;

flv_PlayBack.autoRewind = true;
flv_PlayBack.contentPath = "rtmp://NNN.com/net_abc/_definst_/test";

flv_PlayBack_B.autoRewind = true;
flv_PlayBack_B.contentPath = "rtmp://NNN.com/net_abc/_definst_/test";

//------
var iCount:Number = 0;
var listenerBObject:Object = new Object();
listenerBObject.complete = function(eventObject:Object):Void {
iCount++;
if ( iCount == 2) iCount = 0;
if ( iCount == 1) flv_PlayBack.play();
}
flv_PlayBack.addEventListener("complete", listenerBObject);

//-----
var iCount_B:Number = 0;
var listenerB_BObject:Object = new Object();
listenerB_BObject.complete = function(eventObject:Object):Void {
iCount_B++;
if ( iCount_B == 2) iCount_B = 0;
if ( iCount_B == 1) flv_PlayBack_B.play();
}
flv_PlayBack_B.addEventListener("complete", listenerB_BObject);

//==============

where "NNN.com/net_abc" was changed from my real path, and "test" is the mane of short (10 sec) "flv" clip.

Strangely "complete" event occurs twice in 90% cases and once in 10% cases, so it was necessary to add iCount variable for the control.

Unfortunately one or both videos are frozen after 5-10 cycles, and no error messages.

Does anybody has an idea what's going on?
Memory? Buffer?