FLVPlayback组件不会停止播放时exitframe

编程入门 行业动态 更新时间:2024-10-24 08:22:08
本文介绍了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

本文发布于:2023-07-11 12:21:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1094043.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:组件   FLVPlayback   exitframe

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!