Packageorg.apache.flex.binding
Classpublic class WatcherBase
InheritanceWatcherBase Inheritance Object
Subclasses PropertyWatcher

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The WatcherBase class is the base class for data-binding classes that watch various properties and styles for changes.



Public Properties
 PropertyDefined By
  allowedErrors : Array
[static] Certain errors are normal when executing an update, so we swallow them.
WatcherBase
  allowedErrorTypes : Array
[static] Certain errors classes are normal when executing an update, so we swallow all errors they represent.
WatcherBase
  value : Object
The value of whatever it is we are watching.
WatcherBase
Protected Properties
 PropertyDefined By
  children : Array
Children of this watcher are watching sub values.
WatcherBase
  listeners : Array
The binding objects that are listening to this Watcher.
WatcherBase
Public Methods
 MethodDefined By
  
Constructor.
WatcherBase
  
Add a binding to this watcher, meaning that the binding is notified when our value changes.
WatcherBase
  
addChild(child:WatcherBase):void
Add a child to this watcher, meaning that the child is watching a sub value of ours.
WatcherBase
  
Notify the various bindings that the value has changed so they can update their data binding expressions.
WatcherBase
  
parentChanged(parent:Object):void
This is an abstract method that subclasses implement.
WatcherBase
  
This method is called when the value might have changed and goes through and makes sure the children are updated.
WatcherBase
Protected Methods
 MethodDefined By
  
wrapUpdate(wrappedFunction:Function):void
Calls a function inside a try catch block to try to update the value.
WatcherBase
Property Detail
allowedErrorsproperty
public static var allowedErrors:Array

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Certain errors are normal when executing an update, so we swallow them. Feel free to add more errors if needed.

allowedErrorTypesproperty 
public static var allowedErrorTypes:Array

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Certain errors classes are normal when executing an update, so we swallow all errors they represent. Feel free to add more errors if needed.

childrenproperty 
protected var children:Array

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Children of this watcher are watching sub values. For example, if watching {a.b.c} and this watcher is watching "b", then it is the watchers watching "c" and "d" if there is an {a.b.d} being watched.

listenersproperty 
protected var listeners:Array

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The binding objects that are listening to this Watcher. The standard event mechanism isn't used because it's too heavyweight.

valueproperty 
public var value:Object

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

The value of whatever it is we are watching. For example, if watching {a.b.c} and this watcher is watching "b", then it is the value of "a.b".

Constructor Detail
WatcherBase()Constructor
public function WatcherBase()

Language Version : ActionScript 3.0
Product Version : Flex 3
Runtime Versions : Flash Player 9, AIR 1.1

Constructor.

Method Detail
addBinding()method
public function addBinding(binding:GenericBinding):void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Add a binding to this watcher, meaning that the binding is notified when our value changes. Bindings are classes that actually perform the change based on changes detected to this portion of the chain.

Parameters

binding:GenericBinding — The new binding.

addChild()method 
public function addChild(child:WatcherBase):void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Add a child to this watcher, meaning that the child is watching a sub value of ours. For example, if watching {a.b.c} and this watcher is watching "b", then this method is called to add the watcher watching "c".

Parameters

child:WatcherBase — The new child

notifyListeners()method 
public function notifyListeners():void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Notify the various bindings that the value has changed so they can update their data binding expressions.

parentChanged()method 
public function parentChanged(parent:Object):void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

This is an abstract method that subclasses implement. Implementations handle changes in the parent chain. For example, if watching {a.b.c} and this watcher is watching "b", then handle "a" changing.

Parameters

parent:Object — The new parent.

updateChildren()method 
public function updateChildren():void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

This method is called when the value might have changed and goes through and makes sure the children are updated.

wrapUpdate()method 
protected function wrapUpdate(wrappedFunction:Function):void

Language Version : ActionScript 3.0
Product Version : FlexJS 0.0
Runtime Versions : Flash Player 10.2, AIR 2.6

Calls a function inside a try catch block to try to update the value.

Parameters

wrappedFunction:Function — The function to call.