| 1. |
What Is The Difference Between Changewatcher.watch, And Bindingutils.bindproperty? |
|
Answer» ChangeWatcher: Acts like the watch on AS2. It watches a variable for changes and when SOMETHING happens fires an event. Make sure you call the canWatch to ensure that you can watch it! There are 3 ways to specify the second parameter, the chain.
{ name: property name, ACCESS: function (host) { return host[name] } }.
Works pretty much the same way as the watch, but instead of having to handle and event it allows you to immediately bind two properties one-way.The first two parameters are for the the target, the second parameters are the triggers. BindingUtils.bindProperty( this, "va1", this, "var2"); Note : Make sure you add the flex framework.swc to your project Library Path to have access to the mx.binding.util class. ChangeWatcher: Acts like the watch on AS2. It watches a variable for changes and when something happens fires an event. Make sure you call the canWatch to ensure that you can watch it! There are 3 ways to specify the second parameter, the chain. { name: property name, access: function (host) { return host[name] } }. Works pretty much the same way as the watch, but instead of having to handle and event it allows you to immediately bind two properties one-way.The first two parameters are for the the target, the second parameters are the triggers. BindingUtils.bindProperty( this, "va1", this, "var2"); Note : Make sure you add the flex framework.swc to your project Library Path to have access to the mx.binding.util class. |
|