----- Original Message -----
From: "Rafael Faria" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, September 25, 2008 3:06 AM
Subject: [flexcoders] Re: Binding programmatically
> Paul,
>
> thanks for your message but i might not explain it right.
>
> i will have something like this inside my class
>
> var el:Array = new Array('label1','label2','label3');
>
> for(var i:uint = 0;i<el.length;i++)
> {
> var ti:TextInput = new TextInput();
> ti.id = el[i];
> addChild(ti);
> }
>
> so i cant do what u suggested because "ti" is just a generic variable
> to create the elements.
>
> any other idea?
Yes, write a function:
function allNonBlank():Boolean {
for (var i:uint=0; i< this.numChildren; i++) {
if (this.getChildAt(i).text != "") return false;
}
return true;
}
Then
<mx:Button enabled="{allNonBlank()}" label="submit" />
Haven't tested it - something like that.
Paul
> raf