From the category archives:

String

Have you ever needed to know a character’s Unicode character code and had to spend minutes (or hours) looking it up? Well, here’s a little trick I learnt recently. ActionScript 3.0 (and ActionScript 2.0) have a handy little charCodeAt() method in the String class which takes a numeric parameter which specifies the desired character index in a string, and returns the numeric Unicode character code for that index. A poor explanation, I know, so lets take a look at some code

[click to continue…]

{ 0 comments }