Code snippet: pass preloader flashvars to main swf

Needed some way generic way to get my flashvars from the preloader to the loaded swf

I just extend the url with the flashvars like this

?View Code ACTIONSCRIPT
private function addFlashvars(swfUrl:String):String{
	swfUrl += "?";
	for(var i:String in root.loaderInfo.parameters){
		swfUrl += i + "=" +root.loaderInfo.parameters[i] + "&";
	}
	return swfUrl;
}

Author Bio

Leave a reply