At 8/25/07 02:47 PM, azwsxdcrfv wrote: Quick AS Question
How would I make this code on when a key is released instead of when it is down?
_root.onEnterFrame = function() {
if (Key.isDown(81)) {
if(_quality=="HIGH"){_quality="MEDIUM";}
else if(_quality=="MEDIUM"){_quality="LOW";}
else if(_quality=="LOW"){_quality="HIGH";}
}
}
Firstly, that code is fairly silly. Unless you're super fast with your key presses, it'll just make it cycle through qualities while you hold the key. Either add a variable for release detection or change the event to a key press or release.