Adding Static Properties to a Class: static publicPrivateModifier var propertyName:Datatype;
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
trace(Car.EXTERIOR_COLORS);
}
}
}
class Car{
static public var EXTERIOR_COLORS:Array = ["red", "silver", "gold", "white", "blue"];
}
Related examples in the same category