| Package | feathers.core |
| Interface | public interface IPopUpManager |
| Implementors | DefaultPopUpManager |
| Product Version : | Feathers 1.3.0 |
See also
| Property | Defined By | ||
|---|---|---|---|
| overlayFactory : Function
A function that returns a display object to use as an overlay for
modal pop-ups. | IPopUpManager | ||
| popUpCount : int [read-only]
The current number of pop-ups. | IPopUpManager | ||
| root : DisplayObjectContainer
The container where pop-ups are added. | IPopUpManager | ||
| Method | Defined By | ||
|---|---|---|---|
addPopUp(popUp:DisplayObject, isModal:Boolean = true, isCentered:Boolean = true, customOverlayFactory:Function = null):DisplayObject
Adds a pop-up to the stage. | IPopUpManager | ||
centerPopUp(popUp:DisplayObject):void
Centers a pop-up on the stage. | IPopUpManager | ||
isPopUp(popUp:DisplayObject):Boolean
Determines if a display object is a pop-up. | IPopUpManager | ||
isTopLevelPopUp(popUp:DisplayObject):Boolean
Determines if a display object is above the highest modal overlay. | IPopUpManager | ||
removeAllPopUps(dispose:Boolean = false):void
Removes all pop-ups from the stage. | IPopUpManager | ||
Removes a pop-up from the stage. | IPopUpManager | ||
| overlayFactory | property |
overlayFactory:FunctionA function that returns a display object to use as an overlay for modal pop-ups.
This function is expected to have the following signature:
function():DisplayObject
In the following example, the overlay factory is changed:
PopUpManager.overlayFactory = function():DisplayObject
{
var overlay:Quad = new Quad( 100, 100, 0x000000 );
overlay.alpha = 0.75;
return overlay;
}; public function get overlayFactory():Function public function set overlayFactory(value:Function):void| popUpCount | property |
popUpCount:int [read-only] The current number of pop-ups.
In the following example, we check the number of pop-ups:
if( PopUpManager.popUpCount > 0 )
{
// do something
} public function get popUpCount():int| root | property |
root:DisplayObjectContainerThe container where pop-ups are added. If not set manually, defaults to the Starling stage.
In the following example, the next tab focus is changed:
PopUpManager.root = someSprite; public function get root():DisplayObjectContainer public function set root(value:DisplayObjectContainer):void| addPopUp | () | method |
public function addPopUp(popUp:DisplayObject, isModal:Boolean = true, isCentered:Boolean = true, customOverlayFactory:Function = null):DisplayObjectAdds a pop-up to the stage.
The pop-up may be modal, meaning that an overlay will be displayed
between the pop-up and everything under the pop-up manager, and the
overlay will block touches. The default overlay used for modal
pop-ups is created by PopUpManager.overlayFactory. A
custom overlay factory may be passed to PopUpManager.addPopUp()
to create an overlay that is different from the default one.
A pop-up may be centered globally on the Starling stage. If the
stage or the pop-up resizes, the pop-up will be repositioned to
remain in the center. To position a pop-up in the center once,
specify a value of false when calling
PopUpManager.addPopUp() and call
PopUpManager.centerPopUp() manually.
Note: The pop-up manager can only detect if Feathers components have been resized in order to reposition them to remain centered. Regular Starling display objects do not dispatch a proper resize event that the pop-up manager can listen to.
Parameters
popUp:DisplayObject | |
isModal:Boolean (default = true) | |
isCentered:Boolean (default = true) | |
customOverlayFactory:Function (default = null) |
DisplayObject |
| centerPopUp | () | method |
public function centerPopUp(popUp:DisplayObject):void
Centers a pop-up on the stage. Unlike the isCentered
argument passed to PopUpManager.addPopUp(), the pop-up
will only be positioned once. If the stage or the pop-up resizes,
PopUpManager.centerPopUp() will need to be called again
if it should remain centered.
In the following example, we center a pop-up:
PopUpManager.centerPopUp( displayObject );Parameters
popUp:DisplayObject |
| isPopUp | () | method |
public function isPopUp(popUp:DisplayObject):BooleanDetermines if a display object is a pop-up.
In the following example, we check if a display object is a pop-up:
if( PopUpManager.isPopUp( displayObject ) )
{
// do something
}Parameters
popUp:DisplayObject |
Boolean |
| isTopLevelPopUp | () | method |
public function isTopLevelPopUp(popUp:DisplayObject):BooleanDetermines if a display object is above the highest modal overlay. If there are no modals overlays, determines if a display object is a pop-up.
Parameters
popUp:DisplayObject |
Boolean |
| removeAllPopUps | () | method |
public function removeAllPopUps(dispose:Boolean = false):voidRemoves all pop-ups from the stage.
Parameters
dispose:Boolean (default = false) |
| removePopUp | () | method |
public function removePopUp(popUp:DisplayObject, dispose:Boolean = false):DisplayObjectRemoves a pop-up from the stage.
Parameters
popUp:DisplayObject | |
dispose:Boolean (default = false) |
DisplayObject |