Packagecom.jeffdePascale.fosfr.utils.jsonHandler
Classpublic class JSONHandler
InheritanceJSONHandler Inheritance flash.events.EventDispatcher

The JSONHandler class provides methods for connecting to and receiving back information from JSON handlers.



Public Properties
 PropertyDefined by
  callbackAccessible : Boolean
Specifies whether a callback function with the name specified in the _jsCallback parameter of the constructor is allowed to return information via the JSONHandlerEvent.CALLBACK object.
JSONHandler
Public Methods
 MethodDefined by
  
JSONHandler(_fosfr:FosfrBaseClass, _jsCall:String, _jsCallback:String)
Creates an instance of the JSONHandler class.
JSONHandler
  
call(... args):*
Calls the JSON function specified in the _jsCall parameter of the constructor.
JSONHandler
  
initialize():void
Activates the instance of JSONHandler, making the callback method accessible and setting callbackAccessible to true.
JSONHandler
Events
 EventSummaryDefined by
   Dispatched when the callback function is called from javascript.JSONHandler
Property detail
callbackAccessibleproperty
public var callbackAccessible:Boolean

Specifies whether a callback function with the name specified in the _jsCallback parameter of the constructor is allowed to return information via the JSONHandlerEvent.CALLBACK object. Set to true autoamtically when initialize() is called.

The default value is false.

Constructor detail
JSONHandler()constructor
public function JSONHandler(_fosfr:FosfrBaseClass, _jsCall:String, _jsCallback:String)

Creates an instance of the JSONHandler class.

Parameters
_fosfr:FosfrBaseClass — fosfr An instance of the fosfr class, used for debugging purposes and tests of fosfr.local to avoid security sandbox violations when running locally.
 
_jsCall:String — The name of the javascript method to call from the SWF.
 
_jsCallback:String — The name of the callback function
Method detail
call()method
public function call(... args):*

Calls the JSON function specified in the _jsCall parameter of the constructor.

Parameters
... args — Optional parameters to pass to the specified js function.

Returns
* — The response from the JSON function call. If none is received, returns null.
initialize()method 
public function initialize():void

Activates the instance of JSONHandler, making the callback method accessible and setting callbackAccessible to true. If fosfr.local is false or ExternalInterface is unavailable, debug information will be displayed in the Fosfr debug panel.

Event detail
callbackevent 
Event object type: com.jeffdePascale.fosfr.utils.jsonHandler.JSONHandlerEvent

Dispatched when the callback function is called from javascript.