Sorry, I thought you were trying to update the textcontrols, not the button
I misread your first post.
[Bindable("textBoxUpdated")]
function get buttonEnabled() : Boolean
{
//....
}
private var allTextInputs : Array = [];
//(inside create loop...
ti = new TextInput();
allTextInputs.push(ti); //Can now look at them from buttonEnabled()
ti.addEventListener(ChangeEvent.CHANGE, inputChanged);
//...)
private function inputChanged() : void
{
dispatchEvent(new Event("textBoxUpdated"));
}
<button enabled="{buttonEnabled}"/>
-Josh
On Thu, Sep 25, 2008 at 12:47 PM, Paul Andrews <[EMAIL PROTECTED]> wrote:
> ----- Original Message -----
>
> *From:* Aaron Miller <[EMAIL PROTECTED]>
> *To:* [email protected]
> *Sent:* Thursday, September 25, 2008 3:45 AM
> *Subject:* Re: [flexcoders] Re: Binding programmatically
>
> But then how would this execute the binding when the text is updated?
>
>
> Yes, you're right. Time to get some sleep!
>
>
> What I would do is use BindingUtils.bindProperty on each TextInput to set
> up the bindings in Actionscript.
>
>
> Best Regards,
> ~Aaron
>
> On Wed, Sep 24, 2008 at 7:15 PM, Paul Andrews <[EMAIL PROTECTED]> wrote:
>>
>>
>> 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
>>
>>
>
>
> --
> Aaron Miller
> Chief Technology Officer
> Open Base Interactive, LLC.
> [EMAIL PROTECTED]
> http://www.openbaseinteractive.com
>
>
>
--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."
http://flex.joshmcdonald.info/
:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]