Friday, March 27, 2009

Why would you want to keep a reference to a ChangeWatcher and call unwatch()

Question :Why would you want to keep a reference to a ChangeWatcher and call unwatch()?
Answer :So we can reattach the watcher again & We can change the source object (of changewatcher) by
reset method.
The ChangeWatcher class defines utility methods that you can use with bindable Flex properties.
These methods let you define an event handler that is executed whenever a bindable property is
updated.
unwatch () method:
Detaches this ChangeWatcher instance, and its handler function, from the current host. You can use
the reset() method to reattach the ChangeWatcher instance, or watch the same property or chain on a
different host object.
public function unwatch():void

No comments: