Hey there, I am trying to pass a value from the Doc class to subClass1. This part work fine. subClass1 receives the value and sets an internal variable to the value it got from the Doc class. When I set subClass2 to inherite subClass1 variable I get an error “1203: No default constructor found in base class Aclass.”
I dont know what I am doing wrong. Can anyone Help!
Below is the code of the classes
[COLOR=Red]Doc Class[/COLOR] [COLOR=Red]code[/COLOR]
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class Main extends MovieClip{
var maker:Number = 20
public function Main(){
btn.addEventListener(MouseEvent.MOUSE_DOWN, checker);
}
function checker(event:MouseEvent){
var a_class:Aclass=new Aclass(maker);
trace(a_class.types)
var b_class:Bclass=new Bclass();
trace(b_class.types)
}
}
}
[COLOR=Red]subClass1 code[/COLOR]
package{
public class Aclass {
public var types:Number
public function Aclass(_type:Number){
types = _type
trace('Aclass has been instantiate');
}
}
}
[COLOR=Red]SubClass2 code[/COLOR]
package
{
public class Bclass extends Aclass
{
public function Bclass(){
}
}
}