Emptying A Variable
- Started
- Last post
- 10 Responses
- autonoma
What's the best way to "empty" a variable in Flash? What I mean is, I have this preloading script for preloading mp3 files in my movie. There's a text field on the stage with a variable name of preloadPercent. I want to clear that variable once the loading has completed.
- ilmarine0
well, you could always just give the variable value of " " (i mean, space)...
- o0o0
set it to null or empty string
- autonoma0
How do I set it to null?
- luke0
so if there´s something that "check" the variable for a certain variable let it set the variable to "0" and it will be "0" after the check has been done
- luke0
shit i´m drunk :)
i meant "...checks it for a certain value..."
- londonBoy0
myVariableName = null;
- Epictive0
If you want to check a value (if I am understanding your dunken words) just do something like this:
if (varName=2) {
ACTION;
}or
if (varName>5) {
ACTION;
}etc... If this isnt what you want, drop me an email.
-A
- PeterNorf0
We assign null to a value, array object or object property to indicate that the specified data container does not contain a legal string, number, boolean, array or object value.
myVariable = null;
- autonoma0
Sorry. It was a stupid question that I actually already knew the answer to. I'm just stumped by this goddamn mp3 player I'm building. You know, when you've been staring at nothing but code for hours and it all becomes a jumbled mess?
- PeterNorf0
myVariable1=3
myVariable1=null
trace(myVariable1);