Link to home
Start Free TrialLog in
Avatar of jsound
jsound

asked on

AS2 & OOP: Extend a class or component

This is a general question regarding OOP in AS2.

I know that it is possibl to extend a class or a component with a new class that uses the 'extends' keyword in the class constructor. However, what is not clear to me is whether all the properties and methods in the original class or components have to be redefined in order to use them or whether they just simply work the way they should, unless I override them.

Well, some early tests I did with components caused some issues, which left the extend class not to work at all.

Can someone shed some light on the topic?

What is the best approach to extending an existing class or component?

Thanks,

JB
ASKER CERTIFIED SOLUTION
Avatar of MilesTinsley
MilesTinsley

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Aneesh Chopra
Here I just replying on your point,

Extending a class means, new class will have all properties/methods of the extended class available for use.
no need to redefined it.

yes, you can override any property/method by defining it again in the new class...


Rgds
Aneesh