Recently I made a flex protocol. I want to send the username and password strings in hexadecimal notation to the server, so I am going to search for the solution on the Internet.
Found a good one, number (username. Text). tostring (16), username is the ID of the label Control
However, if the username text is not a pure number, such as a100, the result is Nan undefined.
Continue to find the charcodeat method of string. convert a single character to an ascii code. How can this problem be solved?
For (I = 0; I <username. Text. length; I ++) trace (username. Text. charcodeat (I). tostring (16 ));
So far.
After conversion, use. fromcharcode (ASCII code 1, ASCII Code 2 ,...);
Trace ("New String:" + String. fromcharcode (68,97, 114,111,110 ));
However, the fromcharcode method is a static method. Note the following:
Write it down to reserve