Posted By

1man on 07/03/08


Tagged

class actionscript extend as3


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

taboularasa
t3flexdev
THEPWN3R
themill
tspitzr


Basic Package and Class Creation / Extend


 / Published in: ActionScript 3
 

How to create a basic class in AS3 and extend it if needed.

  1. //In myBaseClass.as
  2. package {
  3. public class myBaseClass {
  4. public function sayHello():void {
  5. trace("hello");
  6. }
  7. }
  8. }
  9. //In mySubClass.as
  10. package {
  11. public class mySubClass extends myBaseClass {
  12. public function sayGoodbye():void {
  13. trace("goodbye");
  14. }
  15. override public function sayHello():void{
  16. trace("This is a trace!");
  17. }
  18. }
  19. }

Report this snippet  

You need to login to post a comment.