Hi guys,
Lets say i have the following inheritance hierarchy:
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.
...
override protected function foo():void {
// do something related to Class C
// call ClassA.foo
ClassA(this).foo();
}
Any help appreciated,