I don't know about AS3 (and I can't imagine this is different from AS2)
but you cannot put any code before super() in a constructor.  

super() must be the first line of code in a constructor.

You should pass the labelClass value to the super constructor (watch
your every move, super constructor).

super("date");

and in your parent 

function ClassName(lc:String) 
{
        labelClass = lc;
}


 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Keith Salisbury
> Sent: Wednesday, January 24, 2007 6:32 AM
> To: Flashcoders mailing list
> Subject: Re: [Flashcoders] AS3 properties woes
> 
> Thanks guys, its was actually my fault,
> 
> the example i gave was a little simpler than my real code, 
> and i discovered i was calling setTitle from inside the super 
> construtor, so obviously if i dont set my subclass variable 
> before calling "super()" it wont use that variable.
> 
> by changing the subclass constructor to this:
> 
> 
> public function DateMarker ()
> {
>        labelClass = "date"
>        super();
> }
> 
> I have the desired functionality....think i probably need to 
> spend some time refactoring tho.....
> 
> The example i've given (aside from Petro's astute comment) 
> should actually work as expected, not as i described!! Sorry 
> for the distractions!!!
> 
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to