Flash AS Question.
Flash AS Question.
- Started
- Last post
- 3 Responses
- biggusdickus
I want to try to change the letters in an input textfield.
For example if the user keypress 'A', the input box will appear some other random letter instead of A.
Is there any tutorials on this issue?
- maximillion_0
use help in flash (F1) and search for "Capturing keypresses ". there's a tut there
- chrisRG0
var arr:Array = ["B", "C", "D", "E", "F"];
function getRandomKey():Void
{
var r:Number = random(arr.length);
trace(arr[r]);
}var keyListener:Object = new Object();
keyListener.onKeyDown = function() {switch(Key.getAscii())
{
case 97: // for a key
case 65: // for A key
getRandomKey();
break;}
};
Key.addListener(keyListener);
- biggusdickus0
alright i get it!
thanks for the replies guys! =)