03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

charCodeAt (String.charCodeAt method)<br />

public charCodeAt(index:Number) : Number<br />

Returns a 16-bit integer from 0 to 65535 that represents the character specified by index. If<br />

index is not a number from 0 to string.length - 1, NaN is returned.<br />

This method is similar to String.charAt() except that the returned value is a 16-bit integer<br />

character code, not a character.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 5<br />

Parameters<br />

index:Number - An integer that specifies the position of a character in the string. The first<br />

character is indicated by 0, <strong>and</strong> the last character is indicated by my_str.length - 1.<br />

Returns<br />

Number - An integer that represents the character specified by index.<br />

Example<br />

In the following example, this method is called on the first letter of the string "Chris":<br />

var my_str:String = "Chris";<br />

var firstChar_num:Number = my_str.charCodeAt(0);<br />

trace(firstChar_num); // output: 67<br />

See also<br />

charAt (String.charAt method)<br />

concat (String.concat method)<br />

public concat(value:Object) : String<br />

Combines the value of the String object with the parameters <strong>and</strong> returns the newly formed<br />

string; the original value, my_str, is unchanged.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 5<br />

Parameters<br />

value:Object - value1[,...valueN] Zero or more values to be concatenated.<br />

Returns<br />

String - A string.<br />

1148 <strong>ActionScript</strong> classes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!