I'm working on an app that has the need for several popup "item
editor" kind of windows.  

Example:  there are people in a list, and when you double click one of
them, you get a popup (TitleWindow) with a form with fields for (and
populated with the selected person's) FirstName, LastName, ... and
save and cancel buttons.

I'm also trying to use the same popup for entering a NEW person, so
that the popup comes up with blank form items.

My first approach was to make an MXML component based off of
TitleWindow, since I have a lot of form elements and layout to add.

But then I ran into the problem.  I want to pass in a Person instance
to populate the form (if I'm in edit mode) or else not pass in
anything (null) if I'm in create-new mode.  In AS, I'd have the
contructor accept a p:Person = null parameter and that would be that.

So.. my question finally.  Is there a way / technoque to pass in
"contructor" types of parameters to an MXML component, or do I need to
suck it up and write the class in AS and deal with all the "addChild's
necessary to create the layout (oh, and it has states)?

Thanks!

-- TC

Reply via email to