ok I googled this and there are many tutorials on how to get the charCode from the character but I cant seem to find out how to get the character from the charcode.
Basically I am I am listening for the KeyDown
event on a TextInput
.
I prevent the char from being typed via event.preventDefault();
Later I need to add the text-char to the TextInput.
I can get the charCode via event.charCode
so if I can turn that into a string I can save it for later user.
Basically I am making a TextInput, that that I can set to display default text in it. When A user types into it, I want to remove the default text first then add the user typed text.
Currently I am either removing it all, or ending up with both.
It's simple:
var yourNewChar:String = String.fromCharCode(event.charCode);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With