cool thanks guys ....I was trying a good way to figure out how to go about
abstract classes

so if the class is abstract I would do

public function AbstractList(){
  throw new Error("Abstract class cannot be instantiated");
}

public function List(){
  //what I need to
  try{
               super();
           }
           catch(err:Error){}
}

this seems to work fine

if anyone has a better suggestion I am all ears :)

cheers
firdosh

On 6/27/07, reflexactions <[EMAIL PROTECTED]> wrote:

  'cos in every class unless you make an explicit call to super there
is an automatic implicit call to super() before anything else
executes in the subclass constructor.

The explicit call to super can include params as in super(x) if the
superclass has such a constructor.

One gotcha is if you extend a class that has a constructor that takes
an argument and decide not to override the constructor then you
extend that class you cant call super with an argument anymore ie

public class classA{
function classA(xx:int){}

...other stuff...
}

public class classB extends classA{
...only other stuff is overridden...
}

public class classC extends classB{
function classC(xx:int){
super(xx);//compile error.... no such constructor in classB
..do some stuff..
}
}

--- In [email protected] <flexcomponents%40yahoogroups.com>,
"Firdosh Tangri" <[EMAIL PROTECTED]>

wrote:
>
> hey guys
> I have a class
>
> public class ClassA{
>
> public function ClassA(){
> trace("classA constructor");
> }
>
> }
>
> ===========================================================
>
> public class ClassB extends ClassA{
>
> public function ClassB (){
> trace("classB constructor");
> }
>
> }
>
> ===================================================================
>
>
> when I do
>
> var c:ClassB = new ClassB();
>
>
> why do both the statements get traced out even though I am not
calling super
>
> cheers
> firdosh
>

Reply via email to