FLVPlayback组件不会停止播放时exitframe [英] flvplayback component doesn't stop playing upon exitframe

查看:181
本文介绍了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 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();
 });

这篇关于FLVPlayback组件不会停止播放时exitframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆