To declare the data type of a variable, use the colon operator right after the name of the variable. : Variable Declare : Data Type Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Data Type » Variable Declare »

 

To declare the data type of a variable, use the colon operator right after the name of the variable.


 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var x:Number;
        var name:String = "Mims";
        
        x = 42;    // No problem
        x = -13;   // No problem
        x = 3.141// No problem

    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Data Type
» Variable Declare