停止 FLVPlaypack 组件

发布于 2024-10-17 11:22:12 字数 635 浏览 2 评论 0原文

您好,

当我从一个帧导航到另一个帧时,我在停止 FLVPlaypack 组件时遇到问题,其中实例名称 (vi) 的播放仍在后台运行。 当闪存加载时,我使用 vi.stop() 来停止播放,我还向每个函数添加了相同的行,当单击按钮时将调用该行,但当我单击任何按钮时,声音仍在后台播放,当我单击按钮(b1)导航到有播放器的第 1 帧,播放器将停止,但声音仍在播放。

请帮我解决这个问题。 我想要的只是当我导航到另一个帧时停止播放器。

这是我的代码:

stop();
vi.stop();
b1.addEventListener(MouseEvent.CLICK, bt1);
b2.addEventListener(MouseEvent.CLICK, bt2);
b3.addEventListener(MouseEvent.CLICK, bt3);

function bt1(evt:MouseEvent) {
    gotoAndStop(1);
    vi.stop();
}
function bt2(evt:MouseEvent) {
    gotoAndStop(2);
    vi.stop();
}
function bt3(evt:MouseEvent) {
    gotoAndStop(3);
    vi.stop();
}

Greeting,

I have problem stopping FLVPlaypack component when I navigate from one frame to another frame that the play which has instance name (vi) still working in back ground.
when the flash loaded I used vi.stop() to stop the play also I added same line to each function that would be called when a button clicked but when I click any button the sound still playing in the background and when I click on the button(b1) which navigate to frame 1 which has the player, the player would be stopped but the sound is still playing.

Please help me to solve this problem.
all what I want is to stop the player when I navigate to another frame.

here is my code:

stop();
vi.stop();
b1.addEventListener(MouseEvent.CLICK, bt1);
b2.addEventListener(MouseEvent.CLICK, bt2);
b3.addEventListener(MouseEvent.CLICK, bt3);

function bt1(evt:MouseEvent) {
    gotoAndStop(1);
    vi.stop();
}
function bt2(evt:MouseEvent) {
    gotoAndStop(2);
    vi.stop();
}
function bt3(evt:MouseEvent) {
    gotoAndStop(3);
    vi.stop();
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

凌乱心跳 2024-10-24 11:22:12

调用“vi.stop();”导航到新帧之前

代码应如下所示:

stop();
vi.stop();
b1.addEventListener(MouseEvent.CLICK, bt1);
b2.addEventListener(MouseEvent.CLICK, bt2);
b3.addEventListener(MouseEvent.CLICK, bt3);

function bt1(evt:MouseEvent) {
    vi.stop();
    gotoAndStop(1);
}
function bt2(evt:MouseEvent) {
    vi.stop();
    gotoAndStop(2);
}
function bt3(evt:MouseEvent) {
    vi.stop();
    gotoAndStop(3);
}

导航到新帧后,您将丢失对 vi FLVPlayback 对象的引用。

call "vi.stop();" before navigating to a new frame

Here's what the code should look like:

stop();
vi.stop();
b1.addEventListener(MouseEvent.CLICK, bt1);
b2.addEventListener(MouseEvent.CLICK, bt2);
b3.addEventListener(MouseEvent.CLICK, bt3);

function bt1(evt:MouseEvent) {
    vi.stop();
    gotoAndStop(1);
}
function bt2(evt:MouseEvent) {
    vi.stop();
    gotoAndStop(2);
}
function bt3(evt:MouseEvent) {
    vi.stop();
    gotoAndStop(3);
}

Once you navigate to a new frame you are losing the reference to the vi FLVPlayback object.

梦回梦里 2024-10-24 11:22:12

对于用户导航到的每个帧,只需添加 SoundMixer.stopAll();

For each frame that the user navigates to just add SoundMixer.stopAll();

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文