Flash 双击外部加载的 SWF

发布于 2024-08-25 07:11:04 字数 596 浏览 1 评论 0原文

我有一个类(它扩展了 MovieClip),可以加载外部 SWF(用 pdf2swf 制作)。它被添加到另一个已声明 doubleClickEnabled = true 的类中,并且我正在侦听 DOUBLE_CLICK 事件。

问题是当加载 SWF 时,我的代码没有拾取 DOUBLE_CLICK 事件,仅拾取 CLICK 事件。我已经尝试过,但没有将 SWF 添加到舞台,它确实会拾取 DOUBLE_CLICK 事件。

有人以前遇到过这个吗?

class ParentClass{
    ...
    public function ParentClass(){
        ...
        mcToLoadSWF = new MovieClip();
        addChild(mcToLoadSWF);
        doubleClickEnabled = true;
        addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickHandler);
        ...
    }
}

我还尝试将事件侦听器添加到 mcToLoadSWF 中。没有骰子。

I've got a class (which extends MovieClip) that loads in an external SWF (made in pdf2swf). That is added to another class which has declared doubleClickEnabled = true and I'm listening for DOUBLE_CLICK events.

The problem is when the SWF is loaded my code picks up no DOUBLE_CLICK events, only CLICK events. I've tried it without adding the SWF to the stage and it does pick up DOUBLE_CLICK events.

Anybody come across this before?

class ParentClass{
    ...
    public function ParentClass(){
        ...
        mcToLoadSWF = new MovieClip();
        addChild(mcToLoadSWF);
        doubleClickEnabled = true;
        addEventListener(MouseEvent.DOUBLE_CLICK, doubleClickHandler);
        ...
    }
}

I've also tried adding the event listener to the mcToLoadSWF as well. No dice.

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

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

发布评论

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

评论(1

烟花易冷人易散 2024-09-01 07:11:04

这里发生的情况是,您双击的是加载的剪辑,它不是 doubleClickEnabled,因此不会生成该事件,也不会像其他鼠标事件一样冒泡到您的剪辑。将 mouseChildren 设置为 false 以不将鼠标事件发送到加载器的子级,但这当然意味着它们中的任何交互都将不起作用。

What's happening here is that what you are double-clicking is the loaded clip, which is not doubleClickEnabled and therefore the event is not generated, and is not bubbled up to your clip like the other mouse events. Set mouseChildren to false to not send mouse events to the children of your loader, but of course this means that any interactivity in them will not work.

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