FLVPlayback组件不会停止播放时exitframe组件、FLVPlayback、exitframe

由网友(偏是执着)分享简介:我有一个时间线中的闪存AS3 Flash应用程序的文件上一帧(不是第一帧)FLVPlayback组件的一个实例。 I have an instance of an flvplayback component on a frame (not the first frame) on a timeline in a fla...

我有一个时间线中的闪存AS3 Flash应用程序的文件上一帧(不是第一帧)FLVPlayback组件的一个实例。

I have an instance of an flvplayback component on a frame (not the first frame) on a timeline in a flash AS3 flash app file.

我想停止电影,当我退出该帧,或者通过gotoAndStop()或任何其他。 是否有一个监听器呢? 或者有什么解决方案,人们知道的?

I would like to stop the movie when i exit that frame, either via gotoAndStop() or whatever else. Is there a listener for this? Or any solution that people know of?

谢谢, JML

推荐答案

您可以随时添加一个ENTER_FRAME监听到父影片剪辑,检查currentFrame得到正确的帧数量,并停止FLV,如果它没有。

You could always add an ENTER_FRAME listener to the parent MovieClip, check if currentFrame yields the correct frame number, and stop the FLV if it doesn't.

但是,如果我理解正确的话,父影片剪辑(主时间轴)不同时播放,而FLV播放,但只有当某种导航的页面上点击。如果是这样,你应该直接反应用户的输入。

But if I understand correctly, the parent MovieClip (the main timeline) isn't playing simultaneously while the FLV plays, but only if some kind of navigation on your page is clicked. If so, you should react directly to the user input.

试试这个:

在每个按钮,导航远离FLV框架,这增加点击监听器:

On each button which navigates away from the FLV frame, add this to the click listener:

 stage.dispatchEvent (new Event ("flvLeave"));

在帧中 flvComponent 的位置(我想这是实例名称,替换为任何你叫你的FLVPlayback组件实例),补充一点:

In the frame where flvComponent is located (I assume this is the instance name, replace with whatever you called your FLVPlayback component instance), add this:

 stage.addEventListener ("flvLeave", function (ev:Event) : void {
      if (flvComponent != null) flvComponent.stop();
 });
阅读全文

相关推荐

最新文章