/ Published in: ActionScript 3

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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); } } }
Comments
