父母与子女之间的SWF股份类别 [英] Share Classes between Parent and Child SWF

查看:219
本文介绍了父母与子女之间的SWF股份类别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我有一种情况下,我想通过一个类的对象,从孩子到家长说'MyBigAwesomeClass。我导入类定义到两个家长和孩子。

So i have a situation where i want to pass a object of a class say 'MyBigAwesomeClass' from a child to a parent. I import the class definition into both the parent and child.

现在,如果我加载从一个位置,相对于母公司的位置SWF子,一切都很好,但现在我使用的是完整的绝对路径加载它,它在父母对待的BigAwesomeClass的定义及在儿童的不同而不允许类型'BigAwesomeClass'的一个目的是要分配给相同的在父类中的一个对象。

Now, if i load the child swf from a location that is relative to the location of the parent , all is fine, however the moment i load it using a full absolute path, it treats the definitions for 'BigAwesomeClass' in parent and in child as different and does not allow an object of the type 'BigAwesomeClass' to be assigned to an object of the same in the parent class.

我完全难倒,并拍着我的头在不同ApplicationDomain,包括使用该code

I am totally stumped, and have banged my head over ApplicationDomains, including using this code

loader.contentLoaderInfo.addEventListener(Event.COMPLETE,swfLoaded);
var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain); 
loader.load(new URLRequest(_file.url),context);

要完全无济于事。 任何想法,我能做些什么就解决这个问题?

To absolutely no avail. Any ideas as to what can i do it fix this ?

在此先感谢

推荐答案

那么原来的沙盒问题。不属于安装的一部分文件被放置在不同的安全沙箱中,并且因为它们位于不同的沙箱中,当导入父的孩子不继承其父在的ApplicationDomain 和两个独立的定义存在着哪些不兼容。可悲的是,似乎有解决这个的没有直接的方法。 Adobe却不允许通过 SandBoxBridge 沙箱之间的通信,但强迫你使用对象类型,哪一种违背了整个事情的目的。至于我可以告诉是没有办法的类在两个不同的沙箱中,即使他们是完全一样的是兼容的。我想它的后面不好受世界上没有严格的分型与对象。

Well it turns out its a Sandbox Issue. Files that are not part of the installer are placed in a different Security Sandbox, and since they reside in different sandboxes, the child when imported into the parent does not inherit the definitions of its Parent in the ApplicationDomain and two separate definitions exist which are incompatible. Sadly, there seems to be no direct way of resolving this. Adobe does allow communication between sandboxes via the SandBoxBridge, but that forces you to use Object type, which kind of defeats the purpose of the whole thing. As far as i can tell there is no way for classes in two different sandboxes to be compatible even though they are exactly the same. I guess its back the painfull world of no strict typing with Objects.

这篇关于父母与子女之间的SWF股份类别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆