I'm changing an action from loadVariablesNum to LoadVars.
I need to put all the variables from the loadVars object into _root.
How do I do that?
regards
pod
Printable View
I'm changing an action from loadVariablesNum to LoadVars.
I need to put all the variables from the loadVars object into _root.
How do I do that?
regards
pod
Well you could try it like this(myVars being the LoadVars object):
/MirandirCode:myVars.onLoad = function(success)
{
if(success)
{
for(i in this)
{
if(typeof(this[i]) != "function")
_root[i] = this[i];
}
}
thanx a bunch it's perfect - you left out a '}'.
I came across the 'delete'-operator wich then can delete the now obsolete object loadvars.thanx again //podCode:ll = new LoadVars();
ll.load(["texter" + language + ".txt"])
ll.onLoad = function(success){
if(success){
for(i in this){
if(typeof(this[i]) != "function")
_root[i] = this[i];
}
delete ll;
}
}