MovieClip |
CoreObject |
The CoreObject class is the top of the API trunk chain. It defines global properties for the API (such as version, copyright notice, etc.) and any methods that are used by any class in the API. Because of the broad nature of this class, it typically contains very few items.
__/ REQUIREMENTS \__
ActionScript 3.0 (or later)
__/ IMPORTS \__
flash.events.Event flash.system.* flash.utils.* flash.display.* com.bnm.api.CoreInterface
__/ EXTENDS \__
flash.display.MovieClip
__/ IMPLEMENTS \__
com.bnm.api.CoreInterface
__/ 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.
CoreObject | The CoreObject class is the top of the API trunk chain. |
Constants | |
_version | (String) The BNMAPI revision number. |
_copyright | (String) The BNMAPI copyright notice. |
Variables | |
API | (BNMAPI) A static reference to the BNMAPI singleton instance. |
_stageExists | (Boolean) TRUE if the main stage object exists, FALSE otherwise. |
CoreObject_environData | (Object) Stores global environment data for the current application. |
CoreObject_stageExistCallbacks | (Array) An array of method references to be called when the main ‘stage’ object instance becomes available. |
CoreObject_stageSearchActive | (Boolean) Tracks whether or not the stage search method is currently active or not. |
Functions and Properties | |
CoreObject | The constructor method for the class. |
setStageCallback | Registers the supplied method with a list of callback methods to invoke when the main `stage` object becomes available. |
onStageExists | Event listener invoked when the main `stage` object becomes available in the associated application. |
get version | Retreives the BNMAPI version number from the constant value. |
version | |
get copyright | Retreives the BNMAPI copyright notice from the constant value. |
copyright | |
get environment | Returns core environment settings and information such as the runtime type (web player, standalone, AIR, etc.) |
environment | |
get runtime | Gets the portion of the environment data that deals specifically with the runtime. |
runtime | |
get stageExists | Returns TRUE if the main `stage` object exists, FALSE otherwise. |
stageExists | |
queryEnvironment | Queries the environment to determine what type of functionality the API should and shouldn’t be allowed to execute. |
searchStageInstance | Waits for the existence of the main “stage” object instance and broadcasts an event/calls associated methods when it becomes available. |
public static var API: Object
(BNMAPI) A static reference to the BNMAPI singleton instance. Any class that extends this class will have automatic access to the API instance (wherever it was created) through this variable. The BNMAPI sets this reference to itself when the whole API chain has finished instantiating, so it should never be directly updated by anything else.
private static var CoreObject_stageExistCallbacks: Array
(Array) An array of method references to be called when the main ‘stage’ object instance becomes available. Adding a method to this array (via a supplied setter) is one way to ensure that a class has a proper reference to the stage object. The other method is to resgister with the “BNMAPI.ONSTAGEEXIST” event.
public function setStageCallback( methodRef: Function ):void
Registers the supplied method with a list of callback methods to invoke when the main `stage` object becomes available. If the stage is already available, the method is invoked immediately.
methodRef (function, required): The method to register for the callback.
nothing
nothing
nothing
no
public function onStageExists( eventObj: Event ):void
Event listener invoked when the main `stage` object becomes available in the associated application. This happens when the first frame event is broadcast since frame events are associated with the existence of the main stage.
none
nothing
BNMAPI.ONSTAGEEXIST
nothing
no
Returns core environment settings and information such as the runtime type (web player, standalone, AIR, etc.). These are detected when the API is instantiated via the queryEnvironment method.
Object: A data object containing various environment settings, variables, and other information.
nothing
nothing
no
Gets the portion of the environment data that deals specifically with the runtime. This includes the runtime type, version, and other information.
Object: A data object containing runtime-specific information from the environment information object.
nothing
nothing
no
private function queryEnvironment():void
Queries the environment to determine what type of functionality the API should and shouldn’t be allowed to execute. For example, JavaScript functions are not allowed when the application is running in the AIR runtime.
none
nothing
CoreObject.ONGETENVIRON
nothing
no
private function searchStageInstance():void
Waits for the existence of the main “stage” object instance and broadcasts an event/calls associated methods when it becomes available. Many classes are instantiated before the main stage exists and Flash will throw an error if this NULL object is accessed before it is ready.
none
nothing
nothing
nothing
no
(String) The BNMAPI revision number.
public const _version: String
(String) The BNMAPI copyright notice.
public const _copyright: String
(BNMAPI) A static reference to the BNMAPI singleton instance.
public static var API: Object
(Boolean) TRUE if the main stage object exists, FALSE otherwise.
public var _stageExists: Boolean
(Object) Stores global environment data for the current application.
private static var CoreObject_environData: Object
(Array) An array of method references to be called when the main ‘stage’ object instance becomes available.
private static var CoreObject_stageExistCallbacks: Array
(Boolean) Tracks whether or not the stage search method is currently active or not.
private static var CoreObject_stageSearchActive: Boolean
The constructor method for the class.
public function CoreObject()
Registers the supplied method with a list of callback methods to invoke when the main `stage` object becomes available.
public function setStageCallback( methodRef: Function ):void
Event listener invoked when the main `stage` object becomes available in the associated application.
public function onStageExists( eventObj: Event ):void
public function get version():String
public function get copyright():String
public function get environment():Object
public function get runtime():Object
public function get stageExists():Boolean
Queries the environment to determine what type of functionality the API should and shouldn’t be allowed to execute.
private function queryEnvironment():void
Waits for the existence of the main “stage” object instance and broadcasts an event/calls associated methods when it becomes available.
private function searchStageInstance():void