Convert CharCode to Char?

What I need

ok I googled this, and there are many tutorials on how to get charCode from a character, but I can't figure out how to get a character from charcode.

Basically, I am listening to the KeyDown on TextInput .

I cannot print char via event.preventDefault();

Later I need to add char text to TextInput.

I can get charCode via event.charCode , so if I can turn this into a string, I can save it for a later user.

Why do I need it

I basically create a TextInput that I can set to display the default text in it. When a user enters text into it, I first want to delete the default text, and then add the text typed by the user.

Currently, I am either deleting all of this or finishing both.

+6
flex char actionscript-3 character character-encoding
source share
1 answer

It's simple:

 var yourNewChar:String = String.fromCharCode(event.charCode); 
+14
source share

All Articles