ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
com.adobe.solutions.exm.runtime 

IComputedExpression  - AS3 Expression Manager

Packagecom.adobe.solutions.exm.runtime
Interfacepublic interface IComputedExpression extends IEventDispatcher

Language Version: ActionScript 3.0
Product Version: Expression Manager Building Block 10
Runtime Versions: AIR (unsupported), Flash Player 10.2

Interface representing an expression managed by the Expression Manager. Consuming applications are expected to obtain a ComputedExpression instance from the Expression Manager and extract the value of the evaluated expression from it:
  • For use-cases where the value is required once and then thrown away, applications can read the 'value' property of the ComputedExpression instance obtained from the Expression Manager and use it. Note that this approach will not work for expressions containing remote function calls which are asynchronous by nature (since the 'value' property will not immediately reflect the actual result of evaluation).
  • For longer-running use-cases (e.g. a UX field is bound to the result of expression evaluation), applications must bind to the 'value' property of the ComputedExpression instance obtained from the Expression Manager. This property is a bindable property which auto-updates whenever an event occurs which affects the result of evaluation (e.g. a variable value changes, a remote function call returns, etc.). Binding is the only approach which works for expressions containing remote function calls.
ComputedExpression instances also dispatch events (ComputationErrorEvent instances) of type "computationErrorEvent" whenever an evaluation error occurs (e.g. a remote function call fails). Apart from binding to the value, applications can listen to these events for detecting errors in evaluation.



Public Properties
 PropertyDefined By
  value : Object
[read-only] Bindable property which holds the result of expression evaluation and auto-updates on events which should cause the expression to recompute.
IComputedExpression
Public Methods
 MethodDefined By
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
IEventDispatcher
 Inherited
Dispatches an event into the event flow.
IEventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
IEventDispatcher
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
IEventDispatcher
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
IEventDispatcher
Events
 Event Summary Defined By
  Dispatched whenever an error occurs during computation of the expression.IComputedExpression
Property Detail

value

property
value:Object  [read-only]

Language Version: ActionScript 3.0
Product Version: Expression Manager Building Block 10
Runtime Versions: AIR (unsupported), Flash Player 10.2

Bindable property which holds the result of expression evaluation and auto-updates on events which should cause the expression to recompute.

This property can be used as the source for data binding. When this property is modified, it dispatches the propertyChange event.



Implementation
    public function get value():Object
Event Detail

computationErrorEvent

Event
Event Object Type: com.adobe.solutions.exm.runtime.ComputationErrorEvent

Language Version: ActionScript 3.0
Product Version: Expression Manager Building Block 10
Runtime Versions: AIR (unsupported), Flash Player 10.2

Dispatched whenever an error occurs during computation of the expression.