Closer to your mx:Binding tag is: BindingUtils.bindProperty( userVO, "Name", this, [ "nameTextInput", "text" ] ); but keep in mind that binding of mx.binding.utils using ChangeWatcher and BindingUtils work differently from the mx.binding package (MXML compiler binding). The latter supports much more use cases, i.e. binding to expressions, XML, having functions and Array elements in property chains, etc. BindingUtils i.e. only supports property chains. I'd question why you would want to replace all our MXML bindings when it's working like a charm for you? ;) Aren't MXML bindings (curly braces, function bindings, mx:Binding/Observe) easier to write and maintain? 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 Mike Anderson
Sent: 20 January 2007 05:14
To: [email protected]
Subject: [flexcoders] BindingUtils.bindProperty versus <mx:Binding>
Hello All,
I am not having much luck, using the bindProperty method of creating
bindings.
At the moment, I am using the <mx:Binding> method, and it's working like
a charm.
But, I am trying to get away from this, so I can put all my binding
logic into my ActionScript Code. I was under the impression, that
BindingUtils.bindProperty was the ActionScript direct replacement for
the <mx:Binding> tag.
A quick example of my usage:
BindingUtils.bindProperty( nameTextInput, "text", userVO, "Name" );
Which replaces:
<mx:Binding source="nameTextInput.text" destination="userVO.Name"/>
I've tried executing the AS code, in the "CreationComplete" and the
"Initialize" Functions of my Control, without any success. I just don't
get any data binding taking place - unless, I am still executing this
code too early, and need to listen for another event. Still, I thought
CreationComplete or Initialize only fired off, when pretty much
everything on the Control was 100% instantiated.
Am I properly using the AS Bindings, or is there something else I am
missing?
Thanks in advance for your help,
Mike
att1c92c.gif
Description: att1c92c.gif

