This is how i’m handling html flash vars:
var flashVars:Object = new Object();
flashVars = this.loaderInfo.parameters;
for (var item:String in flashVars)
{
switch (item)
{
case "phoneNumber" :
phoneNum = String(flashVars[item]);
break;
}
}
A little verbose for only one var, but i like to be flexible to change later on in the project..
anyways, it was more efficient to compose a quick reset function that simply reloads the swf than it would be to compose a matrix of properties for objects that i’m manipulating within the swf; thus, I’m using the following code:
function reset(){
var url = stage.loaderInfo.url;
var request = new URLRequest(url);
navigateToURL(request,"_level0");
}
What I need to do is pass the flashvars from the flashVars object to the request var and i think having a fever is making me over think this… anyone done this before?
You can just pass the flashvars data object to the
dataproperty of your URLRequest: