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?
raf
--- In [email protected], "Paul Andrews" <[EMAIL PROTECTED]> wrote:
>
>
> ----- Original Message -----
> From: "Rafael Faria" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Thursday, September 25, 2008 2:46 AM
> Subject: [flexcoders] Binding programmatically
>
>
> > Hi folks
> >
> > I have a big question.
> >
> > for instance, if i have
> >
> > <mx:TextInput text="" id="myLabel" />
> >
> > <mx:Button enabled="{myLabel.text != ''}" label="submit" />
> >
> >
> > this would mean that if myLabel equals "" my button wil be disabled.
> >
> > What comes to my question.
> >
> > What if myLabel was added programmatically. I mean, what if i create
> > that as myLabel = new Label() but inside a class, so on the mxml side
> > i cant really know what is the instance "myLabel".
> >
> > This is a simple example, but what i have is a lot of TextInput
> > created dynamically and i need to bind some of them to some buttons.
> >
> > how one would do that?
>
> <mx:Button enabled="{classInstanceName.dynamicLabelName.text != ''}"
> label="submit" />
>