Here is an example of the wrong thing to do:
CODE
function firstFunc () {
var aVariable = oneValue;
}
function getVariable () {
trace (aVariable);
}
The trace would return (undefined) because it is undefined in that exact function.
Solution:
do not declare variables inside a function. If you have to, use _root.variableName instead of var variable Name
Here's a sample code:
CODE
function firstFunc () {
_root.aVariable = oneValue;
}
function getVariable() {
trace(_root.aVariable);
}
So, tell me what you think. And if there's a better alternative please do post it.

