Something like...

var formChildren:Array = emailInfoForm.getChildren();
for(var i:int = 0 ; i < formChildren.length ; i++)
{
     if(formChildren[i] is FormItem)
     {
         var formItemChildren:Array = formChildren[i].getChildren();
         if(formItemChildren[0] is TextInput)
         {
             var formItemText:String = (formItemChildren[0] as
TextInput).text;
         }
     }
}


--- In [email protected], venkat eswar <cooler...@...> wrote:
>
> Hi ,
>
> I am adding Textinputs dynamically on clicking Add button.
> How to loop through so that i can get the text of the dynamically
added textinputs.
>
> My code is like this,
>
> public function addForm(event:MouseEvent):void
>             {
>                 i++;
>                 frmItem = new FormItem();
>                 frmItem.direction = "horizontal";
>                 frmItem.label = "Email " + i;
>                 var tb:TextInput = new TextInput();
>                 //tb.id = i.toString();
>                 frmItem.addChild(tb);
>                 emailInfoForm.addChild(frmItem);
>             }
>
> <mx:VBox id="vBox" width="100%" height="100%" verticalAlign="middle"
horizontalAlign="center" paddingBottom="10">
>         <mx:Form id="emailInfoForm">
>         </mx:Form>
>     </mx:VBox>
>

Reply via email to