JavaScript |
Provides extended JavaScript functionality for the BNMAPI above and beyond standard ExternalInterface functionality. Also used extensively by sub-classes like the <com.bnm.api.Events> class.
JavaScript functionality is only available if the current runtime environment supports it. If not, any JavaScripts-specific properties and methods will be disabled.
__/ REQUIREMENTS \__
ActionScript 3.0 (or later)
__/ IMPORTS \__
com.bnm.api.instances.ErrorBroadcast com.bnm.api.instances.Exception flash.external.* com.bnm.api.Payloads flash.xml.*
__/ EXTENDS \__
com.bnm.api.Introspection
__/ IMPLEMENTS \__
nothing
__/ NOTICE \__
©opyright 2008 Bay New Media. All rights, as stipulated in the The MIT License, are reserved.
This ActionScript library is licensed and released under the MIT License (http://www.opensource.org
Please visit http://www.baynewmedia.com/ or email con@baynewm edia.com for information, questions, concerns, or bug reports. tact
__/ NOTES \__
This class is commented using the NaturalDocs documentation system. It is intended to be easily read both from the direct source code and from an adaptation that is generated as hyperlinked HTML. The NaturalDocs specification used in this class’ documentation is version 1.35 though older versions may probably be used safely. For more information, please visit: http://www.naturaldocs.org/
The BNMAPI is officially available (primary sources) on Source Forge (http://sourceforge.net/projects/bnmapi/), on the Bay New Media site (http;//www.baynewmedia.com/), on the PeaBee project site (http://www.peabee.com/), and through the Bay New Media SVM repository server (visit http://www.baynewmedia.com/ for more information). Downloads from other sources may not be complete or up-to-date.
If you’re interested in joining the BNMAPI project in any capacity (development, testing, distribution, etc.), please visit us on Source Forge or the Bay New Media web site.
JavaScript | Provides extended JavaScript functionality for the BNMAPI above and beyond standard ExternalInterface functionality. |
Variables | |
JavaScript_available | (Boolean) Stores whether or not JavaScript is available in the current runtime environment. |
Functions and Properties | |
Events | Constructor method for the class. |
JavaScript | |
alert | Creates a JavaScript `alert` box if JavaScript is available in the current runtime environment. |
get JavaScriptAvailable | Returns the state of the internal static JavaScript_available property. |
JavaScriptAvailable | |
checkJavaScriptEnvironment | Checks the runtime environment for JavaScript availability as well as running some simple tests to determine what JavaScript functionality is available. |
injectJavaScript | Injects JavaScript code into the current web page for later execution. |
getExtendedEnvironmentInformation | Called only if the environment is determined to be JavaScript capable; queries the JavaScript environment for various pieces of information and appends them to the <com.bnm.api.CoreObject> class’ `environment` object. |
public function alert ( alertMessage: *, ... args ):void
Creates a JavaScript `alert` box if JavaScript is available in the current runtime environment.
alertMessage (untyped, required): The message to send to JavaScript alert dialog. May be any type; if it’s not a String type, it will be converted. bypassDetection (Boolean, optional): Bypasses runtime environment detection. This should only be used if it’s suspected that the API is incorrectly detecting the runtime environment and it is desired to force display of the alert dialog. FALSE is default.
nothing
nothing
nothing
no
Returns the state of the internal static JavaScript_available property.
Boolean: TRUE if JavaScript functionality is available in the current runtime environment, FALSE otherwise.
nothing
nothing
no
public function checkJavaScriptEnvironment ():void
Checks the runtime environment for JavaScript availability as well as running some simple tests to determine what JavaScript functionality is available. This method is intended to be incoked by the BNMAPI instance since it requires a number of references and member variables (especially in super classes) to be present.
none
nothing
nothing
nothing
yes
public function injectJavaScript ( code: String ):void
Injects JavaScript code into the current web page for later execution. This is accomplished via the JavaScript “eval” method and may therefore be used for almost any functionality. However, if there is an error in the JavaScript injection code it will fail, so it is advisable to break up injections into smaller chunks. Note that injection does not report errors so it is imperative that any JavaScript code used is thoroughly tested.
code (String, required): The JavaScript source code to inject into the current web page.
nothing
nothing
nothing
no
private function getExtendedEnvironmentInformation ():void
Called only if the environment is determined to be JavaScript capable; queries the JavaScript environment for various pieces of information and appends them to the <com.bnm.api.CoreObject> class’ `environment` object. New properties “browser” and “javascript” are added to the `environment` object for this purpose.
none
nothing
nothing
nothing
yes
(Boolean) Stores whether or not JavaScript is available in the current runtime environment.
private static var JavaScript_available: Boolean
public function JavaScript ()
Creates a JavaScript `alert` box if JavaScript is available in the current runtime environment.
public function alert ( alertMessage: *, ... args ):void
public function get JavaScriptAvailable ():Boolean
Checks the runtime environment for JavaScript availability as well as running some simple tests to determine what JavaScript functionality is available.
public function checkJavaScriptEnvironment ():void
Injects JavaScript code into the current web page for later execution.
public function injectJavaScript ( code: String ):void
Called only if the environment is determined to be JavaScript capable; queries the JavaScript environment for various pieces of information and appends them to the com.bnm.api.CoreObject class’ `environment` object.
private function getExtendedEnvironmentInformation ():void