Return to Snippet

Revision: 19060
at October 15, 2009 13:25 by curiousmedia


Initial Code
package {

	// IMPORTS
	import flash.display.*;
	
	// CLASS DEFINITION
	// must match file name (MyClass.as)
	// convention says start with a capital
	public class MyClass extends MovieClip {
		
		// INSTANCE VARIABLES or PROPERTIES
		private var instanceVariable:String = "I'm an instance variable";
		public var myProperty:String = "I could be a property";
		
		// CONSTRUCTOR
		// runs when an instance of MyClass is created
		// must match class name
		public function MyClass():void {
			trace("instanceVariable: "+instanceVariable);
		}
		
		// METHODS
		private function doSomething():void {
			trace("myProperty: "+myProperty);
		}
	}	
}

Initial URL

                                

Initial Description

                                

Initial Title
Basic Class Structure

Initial Tags

                                

Initial Language
ActionScript 3