简体   繁体   English

AS3-添加预加载器swf后不再接收事件

[英]AS3 - Events are no longer received after adding a preloader swf

This was my initial structure: main.swf -> child.swf 这是我的初始结构:main.swf-> child.swf

Main loads various child swfs. 主要加载各种子SWF。 I am dispatching events from the child swfs, and main is listening for the events. 我正在从子swfs调度事件,主要是监听事件。 Everything was working great. 一切都很好。

Then, I added a preloader swf, so now the structure is: loader.swf -> main.swf -> child.swf 然后,我添加了一个预加载器swf,所以现在的结构是:loader.swf-> main.swf-> child.swf

I did not change the relationship between main and child at all, but now events dispatched by the child are no longer received by main. 我根本没有更改main和child之间的关系,但是现在main不再接收由child调度的事件。 I know they are getting dispatched (using Console.log). 我知道他们正在派遣(使用Console.log)。 Bubbling is set to true. 冒泡设置为true。 Why would main no longer receive events from a child just because I wrapped everything with a loader? 为什么main不再仅仅因为我用装载程序包装了所有东西就收到了孩子的事件?

EDIT: I tried changing useWeakReference to false, in case the listener was getting garbage collected: 编辑:我试图将useWeakReference更改为false,以防监听器被垃圾回收:

this.addEventListener(MyEvent.HELP_ME, imDesperate, false, 0, false);

That didn't make any difference. 没什么区别。

为了使其他访问此问题的人受益,答案是与ApplicationDomain( 在此处进行概述)有关,并在此处得到了解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM