The rule is that components intended for use as MXML tags can't have
constructor parameters. This is because a tag like
<mx:Button id="b" label="OK"/>
essentially ends up being instantiated with the code
b = new Button();
b.label = "OK";
In other words, each attribute becomes an assignment statement. The MXML
compiler wouldn't know what to pass to the constructor.
- Gordon
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Giles
Roadnight
Sent: Wednesday, March 07, 2007 2:42 AM
To: [email protected]
Subject: RE: [flexcoders] Component Constructors
Ok, that's what I thought might be the case.
Thanks
Giles Roadnight
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Soenke
Rohde
Sent: 07 March 2007 10:36
To: [email protected]
Subject: RE: [flexcoders] Component Constructors
MXML components can't have a constructor with parameters.
You should set parameters with setters implemented within the component.
Cheers,
Sönke
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Giles
Roadnight
Sent: Mittwoch, 7. März 2007 11:08
To: [email protected]
Subject: [flexcoders] Component Constructors
When I make an MXML component that extends for example the panel class how
do I get to the constructor?
I want to pass parameters when I create a new login box but can't seem to
get a constructor to work.
Thanks
Giles Roadnight