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

查看:93
本文介绍了flvplayback组件不会在退出帧时停止播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Flash 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

推荐答案

您始终可以向父MovieClip添加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时不会同时播放父MovieClip(主时间轴),只有在单击页面上的某种导航时才可以播放.如果是这样,您应该直接对用户输入做出反应.

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组件不会在退出帧时停止播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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