Mike Keesey hit the nail on the head. By primitives, I meant null, undefined, 
numeric, boolean, and string literals (4, true, "some text"). 

Literal Object and Array instances ( {}, [] ) can also work like primitives in 
a class definition, but they behave a bit oddly because they end up sitting in 
a class's prototype instead of in a class instance.

BTW, you also can't do this:
class MyClass
{
    private static var kMyState:String = "value"; // good
    private static var kMyInitialState:String = kMyState; // bad
}

You've have to write
    private static var kMyInitialState:String = "value";
in order to get the compiler to allow this.

-mark

> 
> From: "Mendelsohn, Michael" <[EMAIL PROTECTED]>
> Date: 2006/06/27 Tue AM 11:55:41 CDT
> To: "Flashcoders mailing list" <[email protected]>
> Subject: RE: [Flashcoders] init TextFormat prop in a class
> 
> Thanks, Mike and John for your responses.
> John: what do you mean by primitives?
> 
> - MM
> 
> 
> 
> > Class properties can only be initialized with primitives outside of a
> constructor
> 
> _______________________________________________
> [email protected]
> 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
> 

--
John Mark Hawley
The Nilbog Group
773.968.4980 (cell)

_______________________________________________
[email protected]
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