I'm new to action script 2.0, what I want is to use the local variables inside the anonymous function
var count = 0;
var evtObject = new Object();
Key.addListener(evtObject);
evtObject.onkeypress = function()
{
if(Key.UP == Key.getCode())
{
// here i want to use the count value., count++;
trace(count);
}
}
Inside the if block i want to use the count value. Even though knowing that it wont work, I used it in the anonymous function of onkeypress, it obviously showed me undefined. Kindly help me to go through this.
if(Key.UP == Key.getCode())trying to achieve?Key.UPis when a key stops being pressed (released) so whatKey.getCode()could it be ever be Equal To? Are you looking for the "up" arrow key?