class org.aswing.AsWingManager
The main manager for AsWing framework.
You may need to call setRoot()
to set a default root container for
AsWing Popups.
Class Fields
static function callNextFrame(func:Dynamic ->Void): Void
Adds a function to the queue to be invoked at next enter frame time
func | the function to be invoked at next frame |
static function getRoot(?checkError:Bool = true): DisplayObjectContainer
Returns the root container which components base on. If you have not set a specified root, the first stage will be the root to be returned.
Take care to use this method if you are working on a multiple native windows AIR project, because there maybe more than one stage.
* @param checkError whethor or not check root is inited set.
@throws AsWingManagerNotInited if checkError and both root and stage is null. @see #setRoot() @see #getStage()
returns | the root container, or null--not root set and AsWingManager not stage inited. * |
static function getStage(?checkError:Bool = true): Stage
Returns the stage inited by initAsStandard()
or setRoot
.
* Take care to use this method if you are working on a multiple native windows AIR project, * because there maybe more than one stage. *
@see #initAsStandard() @see #setRoot()checkError | whethor or not check is stage is inited set. |
returns | the stage. |
static function initAsStandard(root:DisplayObjectContainer, ?_preventNullFocus:Bool = true, ?workWithFlex:Bool = false): Void
Init AsWing as a standard setting. This method is very important for your App.
- If your app is a general Web app or AIR app just have one window(i mean just one stage), you can easy
to pass your root here, and then later you can easy to use
AsWingManager.getStage()
. - If your app is a multi-stage app, (for example AIR app with more than one NativeWindow), you'd better to pass null for this,
then the manager will not reference to your stage to make it is GC able when the NativeWindow is close.
root | the default root container for aswing popups, or null to make no default root. |
_preventNullFocus | set true to prevent focus transfer to null, false, not manage to do this |
workWithFlex | set this to true if your application ui has both AsWing components and Flex components. |
static function initStage(theStage:Stage): Void
Init the stage for AsWing, this method should be better called when flashplayer start. This method will be automatically called when a component is added to stage.
theStage | the stage |
static function isPreventNullFocus(): Bool
Returns the preventNullFocus property. @see #setPreventNullFocus()
returns | true means will prevent focus transfer to null, false means do not manage this. |
static function isStageInited(): Bool
Returns whether or not stage is set to the manager.
returns | whether or not stage is set to the manager. |
static function setInitialStageSize(width:Int, height:Int): Void
Sets the intial stage size, this method generally do not need to use. But some times, you know the manager is not initied at right time, i means some times the manager is inited after the stage is resized, so, you maybe need to call this method to correct the size.
width | the width of stage when application start. |
width | the height of stage when application start. |
static function setPreventNullFocus(prevent:Bool): Void
Sets whether or not prevent focus transfer to null when user click a blank(not focusable object). The default value is true, it is suit for normal applications, if you are develop a app that are complex and may have other interactive object is not aswing components, you may need to set this value to false.
prevent | set true to prevent focus transfer to null, false, not manage to do this |
static function setRoot(root:DisplayObjectContainer): Void
Sets the root container for AsWing components based on.
You'd better call this method before application start, before flashplayer stage resized.
Default isAsWingManager.getStage()
.root | the root container for AsWing popups. |
static function updateAfterMilliseconds(?delay:Int = 20): Void
Force the screen to be updated after a time.
delay | the time |