30 likes | 165 Views
ACtionscript. Syntax, OOP, built-in types. packages. package samples { public class SampleCode { public var sampleGreeting:String ; public function SampleCode () { //do nothing } } } //import all classes in package import samples.*; //import one class only
E N D
ACtionscript Syntax, OOP, built-in types
packages • package samples • { • publicclassSampleCode • { • publicvarsampleGreeting:String; • publicfunctionSampleCode() • { • //do nothing • } • } • } • //import all classes in package • import samples.*; • //import one class only • importsamples.SampleCode;
Variables var i: int; var s: String = "string"; var i: int = 0, s: String = "s"; var u: uint = 0xffffff; //type Object varsomeObject: Object; varsomeObject: Object = {label: 'label'}; //untyped variable varsomeObject: *; vararray: Array; vararray: Array = new Array(); vararray: Array = [1, 2, 3];