开发者

Passing params to an external swf via loader

开发者 https://www.devze.com 2023-02-22 20:46 出处:网络
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 argum

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=pat开发者_如何学Chname/filename.xml

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);

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.


It sounds like what you want is URLVariables:

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

精彩评论

暂无评论...
验证码 换一张
取 消