Otherwise, the inherited vars of the class would be improperly
initialized and code in the superclasses would probably throw errors.
 
BTW, the implicit super() is inserted at the beginning of the
constructor. If you want it called later, you can explicitly write
 
public function ClassA()
{
    trace("classA constructor");
    super();
}
 
- Gordon

________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Josh Tynjala
Sent: Wednesday, June 27, 2007 9:14 PM
To: [email protected]
Subject: Re: [flexcomponents] as3 inheritance query



Even if you don't write it out, super() is called automatically.

-Josh

Firdosh Tangri 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