问题描述
我有一个AS3的SWF说我将要加载其他主权财富基金进入。这些孩子主权财富基金都采取对URL的参数。我似乎无法得到加载AS2的孩子,当它的工作,它需要能够同时处理。
I've got an AS3 SWF that I'm going to be loading other SWFs into. These child SWFs all take a single parameter on the URL. I can't seem to get it working when loading an AS2 child, and it needs to be able to handle both.
让我有
var request:URLRequest = new URLRequest();
var loader:URLLoader = new URLLoader();
request.url = "http://domain/as2.swf?param=foo";
loader.load(request);
// etc on to the eventListeners, addChild, etc
在AS2 SWF被加载,它不能看到我已经传递给它的参数。它在寻找_root.param。我这样做不对还是我与虎谋皮?
When the as2 SWF gets loaded, it can't see the parameter I've passed to it. It's looking for _root.param. Am I doing this wrong or am I attempting the impossible?
编辑:我要补充一点,我可以从一个AS2加载器加载这些URL PARAMS的SWF和它工作得很好
I should add that I can load a SWF with those URL params from an AS2 loader and it works just fine.
推荐答案
这是不平凡的,因为它们在不同的虚拟机上运行AS2和AS3之间进行通信。勾选此http://www.gskinner.com/blog/archives/2007/07/swfbridge_easie.html对于一些提示。
It's not trivial to communicate between AS2 and AS3 since they run in different virtual machines. Check this http://www.gskinner.com/blog/archives/2007/07/swfbridge_easie.html for some hints.
编辑:如果你不能改变使用_root.varname加载的AS2内容你唯一的选择是创建一个使用上面的链接的例子与AS3和接口与加载的AS2内容进行通信的包装AS2装载机这不是pretty的,但它可能只是工作。
If you cannot change the loaded as2 content your only options is creating a 'wrapper' as2 loader that uses the linked example above to communicate with the as3 and interfaces with the loaded as2 content using _root.varname This is not pretty but it might just work.
这篇关于负载AS2 SWF进入AS3 SWF和通瓦尔的网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!