与另一个 as2 swf 中加载的 as2 swf 进行通信

发布于 2024-10-02 18:36:13 字数 180 浏览 0 评论 0原文

我已使用 MovieClipLoader 将一个 AS2 swf 加载到另一个 AS2 swf 中。 我无法控制(无法编辑)子 swf。 有没有办法可以从父 swf 与子 swf 进行通信。

子 swf 不接受任何 LocalConnection 对象。 我可以用其他方式调用子 swf 中的方法吗?

谢谢, 斯里

I have loaded an AS2 swf inside another AS2 swf using MovieClipLoader.
I have no control(cannot edit) over the child swf.
Is there a way I can communicate with the child swf from the parent swf.

The child swf is not accepting any LocalConnection Objects.
Can I call a method in the child swf some other way?

Thanks,
Sri

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

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

发布评论

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

评论(3

情域 2024-10-09 18:36:13

我犯了一个错误,在 onLoadComplete 侦听器中添加与加载的 swf 按钮交互的代码,除非您仅与加载的 swf 容器交互,否则加载的 swf 中的动态文本或按钮不能交互,否则该代码不起作用被访问。要控制子对象内的对象(按钮、动态文本等),请在 onLoadInit 侦听器中添加代码。作为一个例子,

mclListener.onLoadInit = function(childSwf:MovieClip, status:Number):Void { 
    childSwf.btnInsideChild.onRelease = function() 
    {
        childSwf._x += 10;
    }
};

通过单击加载的 swf 内的按钮来移动我加载的 childswf

I made the mistake of adding code interacting with the loaded swf buttons in the onLoadComplete listener which doesn't work unless you are interacting with the loaded swf container only, dynamic text or buttons inside loaded swf can't be accessed. To control the objects inside the child (buttons, dynamic text etc) add your code in the onLoadInit listener. As an example

mclListener.onLoadInit = function(childSwf:MovieClip, status:Number):Void { 
    childSwf.btnInsideChild.onRelease = function() 
    {
        childSwf._x += 10;
    }
};

moved my loaded childswf by clicking the buttons inside the loaded swf

故事还在继续 2024-10-09 18:36:13

初始化后,您可以访问子 swf 上的任何公共方法/属性。监听 onLoadInit 处理程序,并从那里访问子成员。如果您的 swf 存在于同一 AVM 运行时实例中,则不需要 LocalConnection 对象。

you can access any public methods/properties on the child swf after it is initialized. Listen for the onLoadInit handler, and access child members from there. LocalConnection objects aren't required if your swfs exist in the same AVM runtime instance.

临风闻羌笛 2024-10-09 18:36:13

您可以像子MovieClip /自定义类实例一样访问。当您加载时,您必须定义一个变量,并且必须使用变量来访问子外部 swf 的公共方法。它被视为子显示对象。根据 Flash UI 显示列表系统,MovieClip 可以包含无限级别的嵌套子显示对象。

You can access like child MovieClip / Custom Class Instance. When you are loading you have to define one variable and you have to use variable for accessing public methods of the Child external swf. it is treated as Child Display Object. And as per the flash UI Display list system, MovieClip can contains unlimited level nested Child Display Object.

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