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.impl 

SimpleFunctionMapper  - AS3 Expression Manager

Packagecom.adobe.solutions.exm.runtime.impl
Classpublic class SimpleFunctionMapper
InheritanceSimpleFunctionMapper Inheritance EventDispatcher Inheritance Object
Implements IFunctionMapper, IEventDispatcher

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

The default FunctionMapper implementation. This mapper handles two types of function references:
  • Remote function references are of the form "REMOTE_[scope]:[functionName](...)". These resolve to RPC calls and are asynchronous by nature. The remote endpoint used is a Flex remoting destination with ID [scope], and must have a function with name [functionName] defined on it.
  • Local function calls are of the form "[scope]:[functionName](...)" with no special prefix. The [scope] and [functionName] combination must map to a function defined on an ActionScript class which is available in the current ApplicationDomain. This mapping can be loaded from the server on initialization (pass true to the SimpleFunctionMapper constructor), or can be configured by the application using the addFunction() method (or a combination of both).



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
Public Methods
 MethodDefined By
  
SimpleFunctionMapper(initFromServer:Boolean = false)
Creates a new SimpleFunctionMapper instance.
SimpleFunctionMapper
 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.
EventDispatcher
  
addFunction(inExpr:String, actual:String):void
Adds a new local function mapping.
SimpleFunctionMapper
 Inherited
Dispatches an event into the event flow.
EventDispatcher
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
  
resolve(scope:String, functionName:String):Function
Resolves the given scope and function-name to either an RPC operation or a local ActionScript method, depending on whether or not the scope starts with the "REMOTE_" keyword.
SimpleFunctionMapper
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
Constructor Detail

SimpleFunctionMapper

()Constructor
public function SimpleFunctionMapper(initFromServer:Boolean = false)

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

Creates a new SimpleFunctionMapper instance. If the initFromServer flag is true, the calling application must wait for the instance to dispatch an Event of type "serverInitializationSuccess" before the instance can be used. If initialization from the server is unsuccessful, the instance will notify the application by dispatching an Event of type "serverInitializationError".

Parameters
initFromServer:Boolean (default = false) — Whether local function mappings should be loaded from the server.
Method Detail

addFunction

()method
public function addFunction(inExpr:String, actual:String):void

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

Adds a new local function mapping. The mapping is from a function reference of the form "[scope]:[functionName]" to an actual function of the form "[ActionScript_class_name]:[method_name]".

Parameters

inExpr:String — A function reference of the form "[scope]:[functionName]"
 
actual:String — The mapped function, in the format "[ActionScript_class_name]:[method_name]".

resolve

()method 
public function resolve(scope:String, functionName:String):Function

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

Resolves the given scope and function-name to either an RPC operation or a local ActionScript method, depending on whether or not the scope starts with the "REMOTE_" keyword.

Parameters

scope:String — The scope of the function.
 
functionName:String — The name of the function.

Returns
Function — The resolved function.