ActionScript RangeError: Error #1003: The radix argument must be between 2 and 36; got 0.

ActionScript RangeError: Error #1003: The radix argument must be between 2 and 36; got 0.

ActionScript 3 Error #1003 Description:
AS3 error 1003 is describing the fact that the radix parameter is outside of the bounds between 2 and 36. What is a radix you might ask. A radix “specifies the numeric base (from 2 to 36) to use for the number-to-string conversion. If you do not specify the radix parameter, the default value is 10″ Still curious as to what the radix is? Think back to your high school trigonometry class. The radix is the base for the number. In normal scripting/math you use the decimal system. In the decimal system the radix is 10, because it uses the 10 digits from 0 through 9. Binary uses only two number, 0 & 1 therefore it has a base or 2 or radix 2. Octal uses base 8 or radix of 8 and Hexadecimal uses the 16 characters 0-9 and A-f therefore it has a radix of 16. This comes in very handy when you need to convert a number to Hex if you want to generate dynamic colors etc…

Flex / Flash Error 1003 Fix:
So for all that explaining the simply fix for AS3 RangeError 1003 is most likely to just remove whatever value you have in the parenthesis of your toString() or change the value to 10.

Bad Code:

lat_txt.text = “+00 0″+currentLat.toString(this);

or

lat_txt.text = “+00 0″+currentLat.toString(1);

Good Code:

lat_txt.text = “+00 0″+currentLat.toString();

or

lat_txt.text = “+00 0″+currentLat.toString(10);

This should help you resolve Flex / Flash Error #1003

Thanks and as always Happy Flashing

Curtis J. Morley