-
Anyone know of an easy way to clear all variable values in a certain level or just all of them?
-
Use this code to set all variables in _root (or whereever, MC, object etc) to 0 (again, or to whatever, true false etc)...
Code:
for (varname in _root)
{
_root[varname] = 0;
}
-
Or:
varname delete;
But that is not a single function that deletes all
-
I thought it was the other way around...
delete varname;
And you can combine the 2 can't you? Unless this deletes more than you need (like the version number) - will that have side effects?
for (varname in _root)
{
delete varname;
}
So maybe it's wise to contain the required wiped variables in a seperate object/MC to not delete version number...?
-
Yes, it is suppose to be delete varname. I never used it, just remember reading it once
-
Thanks folks.
Haven't had a chance to test it out yet...but I will.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|