I have the following code:
Code:
start();
function start():Void{
var someNumber:Number = 15;
}
_root.onEnterFrame = function():Void{
trace(someNumber); //this gives undefined which is fine and i understand
}
However what i dont understand is when i modify the code to :
Code:
start();
function start():Void{
someNumber = 15;
}
_root.onEnterFrame = function():Void{
trace(someNumber); // This actually gives the value 15 instead of undefined like i expected
}
Does anybody know why this is so? cheers in advance