Skip to content

Instantly share code, notes, and snippets.

@jdeagle
Created November 23, 2013 00:31
Show Gist options
  • Save jdeagle/7609210 to your computer and use it in GitHub Desktop.
Save jdeagle/7609210 to your computer and use it in GitHub Desktop.
Pass root flash vars to a child swf
var flashVars:Object = root.loaderInfo.parameters;
var params:String = "";
var count:Number = 0;
for each (var value:String in flashVars) {
if(count==0){
params += value + "=" + flashVars[value];
} else {
params += "&" + value + "=" + flashVars[value];
}
count++;
}
var ldr:Loader = new Loader();
var url:String = "http://mysite.com/child.swf?" + params;
var urlReq:URLRequest = new URLRequest(url);
ldr.load(urlReq);
addChild(ldr);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment