Use super.methodName to call method in the super class : Super : Class Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Class » Super »

 

Use super.methodName to call method in the super class


 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var rBunny:Rabbit = new Rabbit();
        rBunny.eat();
    }
  }
}

class Mammal {

    public function eat():void {
      trace("mammal");
    }

}

class Rabbit extends Mammal {

    public override function eat():void {
      super.eat();
      trace("rabbit");
    }

}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Class
» Super