Mega Code Archive

 
Categories / Flash ActionScript / Data Type
 

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     }   } }