Mega Code Archive

 
Categories / Flash ActionScript / Data Type
 

Parse number values from strings with bases other than 10 using the parseInt() function

package{   import flash.display.Sprite;      public class Main extends Sprite{     public function Main(){         var nOne:Number = parseInt("11", 10);   // 11         var nTwo:Number = parseInt("11", 2);    // 3         var nThree:Number = parseInt("gg", 17);   // 288     }   } }