通过加载器传递PARAMS到外部SWF加载、PARAMS、SWF

2023-09-08 11:56:57 作者:骑着蜗牛看世界

我从这里 收购了美国的地图(被称为美国的地图)。目前我正在生成XML从内部的ActionScript文件,并会再喜欢用我生成的XML作为参数,以显示该地图。据这个,要做到这一点的HTML要求如下声明:

I have a map of the US acquired from here (called U.S. Map). I am currently generating XML from inside an ActionScript file, and would then like to display this map using my generated XML as the argument. According to this, to do this in html would require the following declaration:

world.swf?data_file=pathname/filename.xml

我如何使用复制从ActionScript装载机这种行为?现在我有:

How can I replicate this behavior using the Loader from ActionScript? Right now I have:

var ldr:Loader = new Loader();
var url:String = "us/us.swf?data_file=senate.xml";
var urlReq:URLRequest = new URLRequest(url);
ldr.load(urlReq);
addChild(ldr);

我想指出,我已经看到这个。然而,它似乎并没有能够解决我的问题,因为我不能编辑美国地图的swf。

I'd like to note that I've already seen this. However, it doesn't seem to be able to solve my problem, since I can't edit the US Map swf.

推荐答案

这听起来像你想要的是使用URLVariables:

It sounds like what you want is URLVariables:

var variables : URLVariables = new URLVariables();
variables.data_file = "senate.xml";
urlReq.data = variables;