I'd like the decendants of my class to be forced to implement their own versions of certain methods. As you can't make virtual methods or classes in flash you have to be creative though, that's why I'm asking if anyone has encountered this problem before and possibly solved it in a clever way?
I tried making an interface, but as the base class got the methods defined (as it will be calling them) the compiler won't complain when the decendant implements the interface without its own method definitions.
What I got so far is this:
Code:class A { public function A () { myFunction (); } public function myFunction () { trace ( "myFunction needs to be written!" ); } }Now if class B hasn't got a myFunction() the base class will trace the error message. It's not a very elegant solution. It won't even tell which class it is that is lacking the function. Help?Code:class B extends A { }![]()




Reply With Quote