2013-02-16 67 views
1

我期待着有一個事件監聽器,它讓我有可能在FLV電影完成播放後開始我的動作。FLV結束Movie監聽器

在AS2中我有函數VideoEvent.COMPLETE,但在AS3中不起作用。

我使用,Flash動作播放器:11.4

+0

這也許回答你的問題...... http://stackoverflow.com/questions/13180087/as3-video-compelete-event-handler-not-working-addeventlistenerevent-complete/13185461# 13185461 – crooksy88 2013-02-16 11:52:11

回答

1

檢查下面的語句添加,

import fl.video.VideoEvent; 

如果仍然沒有工作,然後檢查Flash版本(必須高於10)

然而,沒有解決方案,然後嘗試跟進,

檢查是否是「事件」而不是「VideoEvent」,

yourFLVPlayer.addEventListener(Event.COMPLETE,onFLVPlayingCompleted);

function onFLVPlayingCompleted(e:Event):void 
{ 
     trace("Finished playing FLV"); 
} 

我只是給另一個嘗試,如果event.complete不工作。嘗試下面的代碼。檢查播放頭時間。

yourFLVPlayer.addEventListener(VideoEvent.STATE_CHANGE, flvPlayerStateChanged);  

function flvPlayerStateChanged(e:VideoEvent):void 
{ 
     if (yourFLVPlayer.getVideoPlayer(0).state != "playing") 
     {  
      trace("Stopped playing FLV"); 

      //You might check for playhead time 
      trace(yourFLVPlayer.playheadTime); 

      //if playheadtime is equal to total time of flv then you call it as end of FLV 

     } 
} 
+0

yourFLVPlayer.addEventListener(Event.COMPLETE,onFLVPlayingCompleted);是正確的。謝謝 !問題是,VideoEvent.Comlete更改爲Event.Complete。 – zoom23 2013-02-18 08:47:00