Packagesekati.external
Classpublic class ExternalBase

Advanced ExternalInterface helpers, wrappers & utilities.



Public Properties
 PropertyDefined by
  isReady : Boolean
[static][read-only] Evaluate the application instance to insure an external call can be place successfully:
  • ExternalInterface.isAvailable
  • FlashValidator.isBrowser
  • body.onLoad
ExternalBase
Public Methods
 MethodDefined by
  
ExternalBase Static Constructor
ExternalBase
  
alert(msg:String):void
[static] Javascript alert.
ExternalBase
  
centerPop(wURL:String, wName:String, w:Number, h:Number, scr:Boolean):void
[static] Javascript pop centered window.
ExternalBase
  
[static] Returns the Browser viewport yscroll & height allowing for tests whether the object is within the scrolled view or not.
ExternalBase
  
isExternalAsset(jsObj:String):Boolean
[static] Check if a javascript external asset is installed (and that ExternalInterface is available & the swf is running in browser)
ExternalBase
  
resizeWindow(w:Number, h:Number):void
[static] Javascript resize window.
ExternalBase
  
safeAddCallback(jsFunctionName:String, closure:Function):void
[static] Attempt an ExternalInterface.addCallback if available; catching any resulting errors.
ExternalBase
  
safeCall(js:String):*
[static] Attempt an ExternalInterface.call if available; catching any resulting errors.
ExternalBase
  
safeFunctionCall(jsFunctionName:String, ... jsFunctionArgs):*
[static] Attempt an ExternalInterface.call to a javascript function with arguments, if available; catching any resulting errors.
ExternalBase
  
safeWrappedCall(js:String):*
[static] Wrap a safeCall in an anonymous function to execute complex javascript.
ExternalBase
  
scrollWindow(xpos:uint, ypos:uint):void
[static] Javascript scroll window.
ExternalBase
  
shakeWindow(amount:Number):void
[static] Javascript shake window.
ExternalBase
  
status(msg:String):void
[static] Javascript change status message.
ExternalBase
Property detail
isReadyproperty
isReady:Boolean  [read-only]

Evaluate the application instance to insure an external call can be place successfully:

Implementation
    public static function get isReady():Boolean
Constructor detail
ExternalBase()constructor
public function ExternalBase()

ExternalBase Static Constructor

Method detail
alert()method
public static function alert(msg:String):void

Javascript alert.

Parameters
msg:String
centerPop()method 
public static function centerPop(wURL:String, wName:String, w:Number, h:Number, scr:Boolean):void

Javascript pop centered window.

Parameters
wURL:String
 
wName:String
 
w:Number
 
h:Number
 
scr:Boolean
getBrowserView()method 
public static function getBrowserView():*

Returns the Browser viewport yscroll & height allowing for tests whether the object is within the scrolled view or not.

Returns
* — Object containing the min (scroll from 0) and max (height of browser): { min:0, max:768 }.
isExternalAsset()method 
public static function isExternalAsset(jsObj:String):Boolean

Check if a javascript external asset is installed (and that ExternalInterface is available & the swf is running in browser)

Parameters
jsObj:String — the javascript object or method to check for.

Returns
Booleantrue if asset is available for use, false if not.
resizeWindow()method 
public static function resizeWindow(w:Number, h:Number):void

Javascript resize window.

Parameters
w:Number
 
h:Number
safeAddCallback()method 
public static function safeAddCallback(jsFunctionName:String, closure:Function):void

Attempt an ExternalInterface.addCallback if available; catching any resulting errors.

Parameters
jsFunctionName:String — the javascript function to add a callback to.
 
closure:Function — the actionscript function to fire.
safeCall()method 
public static function safeCall(js:String):*

Attempt an ExternalInterface.call if available; catching any resulting errors.

Parameters
js:String — the raw javascript to execute with error handling.

Returns
* — the return value of the javascript call.

See also

flash.external.ExternalInterface.call
safeFunctionCall()method 
public static function safeFunctionCall(jsFunctionName:String, ... jsFunctionArgs):*

Attempt an ExternalInterface.call to a javascript function with arguments, if available; catching any resulting errors.

Parameters
jsFunctionName:String — the raw javascript to execute with error handling.
 
... jsFunctionArgs — the arguments to be passed in to the javascript call.

Returns
* — the return value of the javascript call.

See also

flash.external.ExternalInterface.call
safeWrappedCall()method 
public static function safeWrappedCall(js:String):*

Wrap a safeCall in an anonymous function to execute complex javascript.

Parameters
js:String — javascript method code sans function(){ ... } wrapping.

Returns
* — the return value of the javascript call.

See also

flash.external.ExternalInterface.call

Example
    var test : Boolean = ExternalBase.safeWrappedCall( "var b = true; return b;" ); // creates & executes: "function(){ var b = true; return b; };"
    trace( test );
   

scrollWindow()method 
public static function scrollWindow(xpos:uint, ypos:uint):void

Javascript scroll window.

Parameters
xpos:uint
 
ypos:uint
shakeWindow()method 
public static function shakeWindow(amount:Number):void

Javascript shake window.

Parameters
amount:Number
status()method 
public static function status(msg:String):void

Javascript change status message.

Parameters
msg:String