Packagebridge
Classpublic class FABridge
InheritanceFABridge Inheritance flash.events.EventDispatcher
Implements mx.core.IMXMLObject

The FABridge class, responsible for proxying AS objects into javascript



Public Properties
 PropertyDefined By
  bridgeName : String
the bridge name
FABridge
  rootObject : DisplayObject
FABridge
Public Methods
 MethodDefined By
  
FABridge
  
addCachedTypeDescription(className:String, desc:Object):Object
FABridge
  
addCustomSerialization(className:String, serializationFunction:Function):void
FABridge
  
buildTypeDescription(className:String):Object
builds a type description for the type indiciated by className
FABridge
  
deserialize(valuePackage:*):*
deserializes a value passed in from javascript.
FABridge
  
getFunctionID(f:Function, createIfNecessary:Boolean):Number
associates a unique ID with a local function suitable for passing across the bridge to proxy in Javascript
FABridge
  
getRef(obj:Object, createIfNecessary:Boolean):Number
returns an id associated with the object provided for passing across the bridge to JS
FABridge
  
getRemoteFunctionProxy(functionID:Number, createIfNecessary:Boolean):Function
returns a proxy function that represents a function defined in javascript.
FABridge
  
incRef(objId:int):void
increment the reference count for an object being passed over the bridge
FABridge
  
attaches the callbacks to external interface
FABridge
  
initialized(document:Object, id:String):void
called to check whether the bridge has been initialized for the specified document/id pairs
FABridge
  
js_getPropFromAS(objID:Number, propName:String):*
called to fetch a named property off the instanced associated with objID
FABridge
  
releaseRef(objId:int):void
when an object has been completely passed to JS its reference count is decreased with 1
FABridge
  
retrieveCachedTypeDescription(className:String, createifNecessary:Boolean):Object
retrieves a type description for the type indicated by className, building one and caching it if necessary
FABridge
  
serialize(value:*, keep_refs:Boolean = false):*
serializes a value for transfer across the bridge.
FABridge
Public Constants
 ConstantDefined By
  EventsToCallLater : Object
[static]
FABridge
  INITIALIZED : String = bridgeInitialized
[static]
FABridge
  MethodsToCallLater : Object
[static]
FABridge
  TYPE_ANONYMOUS : uint = 4
[static]
FABridge
  TYPE_ASFUNCTION : uint = 2
[static]
FABridge
  TYPE_ASINSTANCE : uint = 1
[static]
FABridge
  TYPE_JSFUNCTION : uint = 3
[static]
FABridge
Property Detail
bridgeNameproperty
public var bridgeName:String

the bridge name

rootObjectproperty 
rootObject:DisplayObject


Implementation
    public function get rootObject():DisplayObject
    public function set rootObject(value:DisplayObject):void
Constructor Detail
FABridge()Constructor
public function FABridge()



Method Detail
addCachedTypeDescription()method
public function addCachedTypeDescription(className:String, desc:Object):Object

Parameters

className:String
 
desc:Object

Returns
Object
addCustomSerialization()method 
public function addCustomSerialization(className:String, serializationFunction:Function):void

Parameters

className:String
 
serializationFunction:Function

buildTypeDescription()method 
public function buildTypeDescription(className:String):Object

builds a type description for the type indiciated by className

Parameters

className:String

Returns
Object
deserialize()method 
public function deserialize(valuePackage:*):*

deserializes a value passed in from javascript. See serialize for details on how values are packed and unpacked for transfer across the bridge.

Parameters

valuePackage:*

Returns
*
getFunctionID()method 
public function getFunctionID(f:Function, createIfNecessary:Boolean):Number

associates a unique ID with a local function suitable for passing across the bridge to proxy in Javascript

Parameters

f:Function
 
createIfNecessary:Boolean

Returns
Number
getRef()method 
public function getRef(obj:Object, createIfNecessary:Boolean):Number

returns an id associated with the object provided for passing across the bridge to JS

Parameters

obj:Object
 
createIfNecessary:Boolean

Returns
Number
getRemoteFunctionProxy()method 
public function getRemoteFunctionProxy(functionID:Number, createIfNecessary:Boolean):Function

returns a proxy function that represents a function defined in javascript. This function can be called syncrhonously, and will return any values returned by the JS function

Parameters

functionID:Number
 
createIfNecessary:Boolean

Returns
Function
incRef()method 
public function incRef(objId:int):void

increment the reference count for an object being passed over the bridge

Parameters

objId:int

initializeCallbacks()method 
public function initializeCallbacks():void

attaches the callbacks to external interface

initialized()method 
public function initialized(document:Object, id:String):void

called to check whether the bridge has been initialized for the specified document/id pairs

Parameters

document:Object
 
id:String

js_getPropFromAS()method 
public function js_getPropFromAS(objID:Number, propName:String):*

called to fetch a named property off the instanced associated with objID

Parameters

objID:Number
 
propName:String

Returns
*
releaseRef()method 
public function releaseRef(objId:int):void

when an object has been completely passed to JS its reference count is decreased with 1

Parameters

objId:int

retrieveCachedTypeDescription()method 
public function retrieveCachedTypeDescription(className:String, createifNecessary:Boolean):Object

retrieves a type description for the type indicated by className, building one and caching it if necessary

Parameters

className:String
 
createifNecessary:Boolean

Returns
Object
serialize()method 
public function serialize(value:*, keep_refs:Boolean = false):*

serializes a value for transfer across the bridge. primitive types are left as is. Arrays are left as arrays, but individual values in the array are serialized according to their type. Functions and class instances are inserted into a hash table and sent across as keys into the table. For class instances, if the instance has been sent before, only its id is passed. If This is the first time the instance has been sent, a ref descriptor is sent associating the id with a type string. If this is the first time any instance of that type has been sent across, a descriptor indicating methods, properties, and variables of the type is also sent across

Parameters

value:*
 
keep_refs:Boolean (default = false)

Returns
*
Constant Detail
EventsToCallLaterConstant
public static const EventsToCallLater:Object

INITIALIZEDConstant 
public static const INITIALIZED:String = bridgeInitialized

MethodsToCallLaterConstant 
public static const MethodsToCallLater:Object

TYPE_ANONYMOUSConstant 
public static const TYPE_ANONYMOUS:uint = 4

TYPE_ASFUNCTIONConstant 
public static const TYPE_ASFUNCTION:uint = 2

TYPE_ASINSTANCEConstant 
public static const TYPE_ASINSTANCE:uint = 1

TYPE_JSFUNCTIONConstant 
public static const TYPE_JSFUNCTION:uint = 3