PDA

View Full Version : subclass method inheritance


carn1x
06-27-2008, 09:24 PM
Hellooo,

I have a class called Creature with method KillCreature.

I also have a class Enemy extends Creature

I seem to be having problems using Enemy.killCreature().

I do not wish to modify the killCreature() method in anyway, please help! :)

wvxvw
06-27-2008, 11:10 PM
...
public class Enemy extends Creature {
...
public override function killCreature():void
{
super.killCreature();
}
}
This will work the same way as if you didn't declared it in the extending class, but will give you the possibility to trace it from there.