PDA

View Full Version : Inheritance class not being seen


FEK315
04-17-2010, 11:58 PM
I am learning about inheritance.
I have 3 class files that get called from one SWF.
Car.as and Truck.as inherit a constructor from the main class Vehicle.as

My main.fla creates a Car and Truck object and gives them each a trace statement, so I know that each has been created.

My problem is that I keep getting this error:
[COLOR="red"]1203: No default constructor found in base class Vehicle.

my files are all in the same folder. Why won't the swf see the construtor in Vehicle Car and Truck.as files?
I got Vehicle.as to work when it was the only class file by declaring it in the FLA Property Document Class box. I know this has some thing to do with my error message but I can't seem to fix it.
Thank you

vinayak.kadam
04-19-2010, 09:57 AM
Hey there,

This link (http://www.flepstudio.org/forum/object-oriented-programming-tutorials/1605-tutorial-9-inheritance.html)contains some discussion related to your query. I tried understanding it, but did not had enough time to solve your issue.

vinayak.kadam
04-19-2010, 11:14 AM
Hey there,

Here's the resolution to your issue....

Constructor of subclass should actually call the construtor of superclass using the keyword super() and it should supply exact number of arguments to its call.

You may check the attachments to know more.

FEK315
04-19-2010, 02:44 PM
Thank you this helped me solve my problem.
TNX