0

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

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.

Community
  • 1
  • 1
cryptic_star
  • 1,863
  • 3
  • 26
  • 47

1 Answers1

1

It sounds like what you want is URLVariables:

var variables : URLVariables = new URLVariables();
variables.data_file = "senate.xml";
urlReq.data = variables;
jhocking
  • 5,527
  • 1
  • 24
  • 38
  • Right you are! Many thanks - I'd been scouring the internet trying to find the answer, but I don't think I was phrasing the question correctly. :) – cryptic_star Apr 05 '11 at 21:14