parseInt() Function in ActionScript

Notes:

parseInt() Function in ActionScript Programming Language:

Explicit type casting:
If required, programmers can also convert one type of value to another type.
This is known as explicit type casting.

For explicit type casting, we use built in type casting functions or wrapper functions:
parseInt function
parseFloat function
wrapper functions

parseInt(string):Number :=
Converts a given string to an integer number, if not possible to convert then returns NaN value
It tries to extract and return the beginning integer part.
If string passed to the parseInt function does not begin with integer number then it returns NaN value
Ex:
trace(parseInt("24")); // 24
trace(parseInt("3.142")); // 3
trace(parseInt("24sometext")); // 24
trace(parseInt("2"+"4")); // 24
trace(parseInt("2"+"4a")); // 24
trace(parseInt("2a"+"4a")); // 2
trace(parseInt("1/2")); // 1
trace(parseInt("sometext24")); // NaN