Maybe you're running into a bug here. Try adding the following handler
to the updateComplete event of your Form component.
 
   private function initializeForm( form : Form ) : void
   {
    var target : Form = form;
    if( target == null ) return;
    
    for each( var child : UIComponent in target.getChildren() )
    {
     if( child is FormItem )
     {
      child.invalidateSize();
     }
    }    
   }
 
 
Best,
Alex

         Alex Uhlmann 
Consultant (Rich Internet Applications)
Adobe Consulting
Westpoint, 4 Redheughs Rigg, 
South Gyle, Edinburgh, EH12 9DQ, UK
p: +44 (0) 131 338 6969
m: +44 (0) 7917 428 951
[EMAIL PROTECTED]
http://weblogs.macromedia.com/auhlmann

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of brian_m_riley
Sent: 26 December 2006 21:57
To: [email protected]
Subject: [flexcoders] Using View States with Form Container



I've created a base state with a Form (we'll call it "myForm")
containing 3 FormItems each containing a TextInput; I've also created
2 additional view states:

State "FooA" just has a FormItem with a ComboBox and is based on above
base state, and is added as the last child of "myForm".

State "FooB" has 2 FormItems, one with a ComboBox, and the other with
a TextInput and is also based on the above base state, and is also
added as the last children of "myForm".

I change the state depending on the input in the 3rd TextInput in the
base state. The states change correctly, and I see the additional form
fields, but they do not vertically align with the rest of the fields
in the base form. The added fields are always shifted to the right.

Thoughts?
-riley



 

Attachment: adobe_logo.gif
Description: adobe_logo.gif

Reply via email to