通过加载器传递PARAMS到外部SWF [英] Passing params to an external swf via loader

查看:168
本文介绍了通过加载器传递PARAMS到外部SWF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从这里 收购了美国的地图(被称为美国的地图)。目前我正在生成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;

这篇关于通过加载器传递PARAMS到外部SWF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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