roflmao456 is right about that. You can use that bit of code for your timer event. I didn't think that my instruction was that hard to understand?
A
global variable is nothing more than a variable defined in the
global scope of a script, so that the variable can be accessed from anywhere in the script. If you define the variable in the scope of a function, it will only be accessible in that particular function and will also be destroyed when the function ends.
code:
var MyVar = 25; //This is a variable defined in the global scope
function Test() {
Debug.Trace("MyVar equals "+MyVar); //This will result in "MyVar equals 25"
}
function Test3() {
MyVar = "test"; //Set the value of MyVar in the global scope
Debug.Trace("MyVar equals "+MyVar); //This will result in "MyVar equals test"
}
function Test3() {
var MyVar = "test"; //Set the value of MyVar in this function's scope
Debug.Trace("MyVar equals "+MyVar); //This will result in "MyVar equals test", but the global MyVar will be unaffected
}