/ Published in: ActionScript 3
How to create a basic class in AS3 and extend it if needed.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//In myBaseClass.as package { public class myBaseClass { public function sayHello():void { trace("hello"); } } } //In mySubClass.as package { public class mySubClass extends myBaseClass { public function sayGoodbye():void { trace("goodbye"); } override public function sayHello():void{ trace("This is a trace!"); } } }