# Super, Override and Inheritance chain

**URL:** https://forum.kirupa.com/t/super-override-and-inheritance-chain/289682
**Category:** flash
**Created:** [June 3, 2009, 10:25am UTC](https://forum.kirupa.com/t/super-override-and-inheritance-chain/289682 "2009-06-03T10:25:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gone2far](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@gone2far](https://forum.kirupa.com/u/gone2far)
#### Post date: [June 3, 2009, 10:25am UTC](https://forum.kirupa.com/t/super-override-and-inheritance-chain/289682/1 "2009-06-03T10:25:35Z")

</div>

Hi guys,

Lets say i have the following inheritance hierarchy:

```auto

package {
    
    public class ClassA {
        
        protected function foo():void {
            // do something
        }
    }
}

package {
    
    public class ClassB extends ClassA {
        
        override protected function foo():void {
            // do something related to Class B
            // call super
            super.foo();
        }
    }
}

package {
    
    public class ClassC extends ClassB {
        
        override protected function foo():void {
            // do something related to Class C
            // call super
            super.foo();
        }
    }
}

```

Now this is all well and good, as the call to _ClassC.foo()_ will propogate through the inheritance chain; C \> B \> A. But what if I want _ClassC.foo()_ to call _foo()_ that is in _ClassA_ and bypass the method call in _ClassB_?

I have tried the following:

- Cast the method to the super-class type I want to execute, but this does not work as intended.

```auto

...
override protected function foo():void {
    // do something related to Class C
    // call ClassA.foo
    ClassA(this).foo();
}

```

Any help appreciated,
