flv电影监听器结束

时间:2013-02-16 11:02:41

标签: actionscript-3 flash flv flvplayer

我期待有一个事件监听器,这使我有可能在FLV电影完成播放后开始我的动作。

在AS2中,我使用了VideoEvent.COMPLETE函数,但在AS3中不起作用。

我正在使用Flash Action Player:11.4

1 个答案:

答案 0 :(得分:1)

检查是否添加了以下语句

 import fl.video.VideoEvent;

如果仍然无效,请检查Flash版本(必须高于10)

然而,没有解决方案尝试跟随,

检查它是“Event”而不是“VideoEvent”,

yourFLVPlayer.addEventListener(Event.COMPLETE,onFLVPlayingCompleted);

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

如果event.complete不起作用,我只是给另一个试用版。请尝试以下代码。检查playheadTime。

 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

      }
 }
相关问题