Created
November 23, 2013 00:31
-
-
Save jdeagle/7609210 to your computer and use it in GitHub Desktop.
Pass root flash vars to a child swf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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