mrtabs
10-05-2007, 01:03 PM
Hi all,
i have a problem with "complete" event for VideoDisplay.
Here is my code. I only use local video files. If i play a small flv video, it works (just some seconds). But if i play a video a little bit bigger (like some minutes), the complete event doesn't happens?
Can u help me????
Thanks!!!
(and sorry about my english)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initHandler(event)" >
<mx:VideoDisplay x="153" y="138" width="368" height="286" id="vd1" source="{FLV_URL}" autoPlay="false" autoRewind="false" complete="OnComplet(event)"/>
<mx:Script>
<![CDATA[
import mx.events.VideoEvent;
import mx.controls.Alert;
[Bindable]
private var FLV_URL:String;
[Bindable]
private var FLV_URL1:String = "assets/vd1.flv";
[Bindable]
private var FLV_URL2:String = "assets/vd2.flv";
private var flag:Boolean = false;
private function initHandler(event:Event):void {
FLV_URL = FLV_URL1;
vd1.play();
}
public function OnComplet(event:VideoEvent):void {
if (flag == false) {
FLV_URL = FLV_URL2;
flag = true;
} else {
FLV_URL = FLV_URL1;
flag = false;
}
vd1.play();
}
]]>
</mx:Script>
</mx:Application>
i have a problem with "complete" event for VideoDisplay.
Here is my code. I only use local video files. If i play a small flv video, it works (just some seconds). But if i play a video a little bit bigger (like some minutes), the complete event doesn't happens?
Can u help me????
Thanks!!!
(and sorry about my english)
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initHandler(event)" >
<mx:VideoDisplay x="153" y="138" width="368" height="286" id="vd1" source="{FLV_URL}" autoPlay="false" autoRewind="false" complete="OnComplet(event)"/>
<mx:Script>
<![CDATA[
import mx.events.VideoEvent;
import mx.controls.Alert;
[Bindable]
private var FLV_URL:String;
[Bindable]
private var FLV_URL1:String = "assets/vd1.flv";
[Bindable]
private var FLV_URL2:String = "assets/vd2.flv";
private var flag:Boolean = false;
private function initHandler(event:Event):void {
FLV_URL = FLV_URL1;
vd1.play();
}
public function OnComplet(event:VideoEvent):void {
if (flag == false) {
FLV_URL = FLV_URL2;
flag = true;
} else {
FLV_URL = FLV_URL1;
flag = false;
}
vd1.play();
}
]]>
</mx:Script>
</mx:Application>