How to convert hex(in string) to decimal(int) in Actionscript3?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Number,intanduintclass havingtoString()method which acceptradixas arguments.radixSpecifies 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.you can convert to any base like octal, hex, binary via Number and uint class.
Better way
var decimal:int = parseInt("FFFFFF",16);// output : 16777215Another way
var hexint:int = int(hex);// output : 16777215it is equivalent to
var hexint:int = int(hex).toString(10);//Decimal conversionBack to original value :