Use int() method to convert boolean value to integer : Type cast « Data Type « Flash / Flex / ActionScript






Use int() method to convert boolean value to integer

 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        int(true);  // Yields 1
        int(false);  // Yields 0

    }
  }
}

        








Related examples in the same category

1.Use int() method to convert float number to integer
2.Convert undefined to Number
3.Convert null to number