Package | feathers.controls |
Class | public class Drawers |
Inheritance | Drawers ![]() ![]() |
Additionally, each drawer may be individually "docked" in an always-open state, making this a useful application-level layout container even if the drawers never need to be hidden. Docking behavior may be limited to either portrait or landscape, or a drawer may be docked in both orientations. By default, a drawer is not docked.
The following example creates an app with a slide out menu to the left of the main content:
var navigator:StackScreenNavigator = new StackScreenNavigator(); var list:List = new List(); // the navigator's screens, the list's data provider, and additional // properties should be set here. var drawers:Drawers = new Drawers(); drawers.content = navigator; drawers.leftDrawer = menu; drawers.leftDrawerToggleEventType = Event.OPEN; this.addChild( drawers );
In the example above, a screen in the StackScreenNavigator
component dispatches an event of type Event.OPEN
when it
wants to display the slide out the List
that is used as
the left drawer.
See also
Property | Defined By | ||
---|---|---|---|
autoSizeMode : String
Determines how the drawers container will set its own size when its
dimensions (width and height) aren't set explicitly. | Drawers | ||
bottomDrawer : DisplayObject
The drawer that appears below the primary content. | Drawers | ||
bottomDrawerDockMode : String
Determines if the bottom drawer is docked in all, some, or no stage
orientations. | Drawers | ||
bottomDrawerToggleEventType : String
When this event is dispatched by the content event dispatcher, the
bottom drawer will toggle open and closed. | Drawers | ||
clipDrawers : Boolean
Determines if the drawers are clipped while opening or closing. | Drawers | ||
content : DisplayObject
The primary content displayed in the center of the container. | Drawers | ||
contentEventDispatcherChangeEventType : String
The event dispatched by the content to indicate that the content
event dispatcher has changed. | Drawers | ||
contentEventDispatcherField : String
A property of the content that references an event
dispatcher that dispatches events to toggle drawers open and closed. | Drawers | ||
contentEventDispatcherFunction : Function
A function that returns an event dispatcher that dispatches events to
toggle drawers open and closed. | Drawers | ||
![]() | defaultTextEditorFactory : Function [static]
A function used by all UI controls that support text editor to
create an ITextEditor instance. | FeathersControl | |
![]() | defaultTextRendererFactory : Function [static]
A function used by all UI controls that support text renderers to
create an ITextRenderer instance. | FeathersControl | |
![]() | depth : int [read-only]
The component's depth in the display list, relative to the stage. | FeathersControl | |
![]() | focusIndicatorSkin : DisplayObject
If this component supports focus, this optional skin will be
displayed above the component when showFocus() is
called. | FeathersControl | |
![]() | focusManager : IFocusManager | FeathersControl | |
![]() | focusOwner : IFocusDisplayObject | FeathersControl | |
![]() | focusPadding : Number
Quickly sets all focus padding properties to the same value. | FeathersControl | |
![]() | focusPaddingBottom : Number
The minimum space, in pixels, between the object's bottom edge and the
bottom edge of the focus indicator skin. | FeathersControl | |
![]() | focusPaddingLeft : Number
The minimum space, in pixels, between the object's left edge and the
left edge of the focus indicator skin. | FeathersControl | |
![]() | focusPaddingRight : Number
The minimum space, in pixels, between the object's right edge and the
right edge of the focus indicator skin. | FeathersControl | |
![]() | focusPaddingTop : Number
The minimum space, in pixels, between the object's top edge and the
top edge of the focus indicator skin. | FeathersControl | |
globalStyleProvider : IStyleProvider [static]
The default IStyleProvider for all Drawers
components. | Drawers | ||
![]() | height : Number [override]
The height of the component, in pixels. | FeathersControl | |
![]() | includeInLayout : Boolean
Determines if the ILayout should use this object or ignore it. | FeathersControl | |
isBottomDrawerDocked : Boolean [read-only]
Indicates if the bottom drawer is currently docked. | Drawers | ||
isBottomDrawerOpen : Boolean
Indicates if the bottom drawer is currently open. | Drawers | ||
![]() | isCreated : Boolean [read-only]
Determines if the component has been initialized and validated for
the first time. | FeathersControl | |
![]() | isEnabled : Boolean
Indicates whether the control is interactive or not. | FeathersControl | |
![]() | isFocusEnabled : Boolean | FeathersControl | |
![]() | isInitialized : Boolean [read-only]
Determines if the component has been initialized yet. | FeathersControl | |
isLeftDrawerDocked : Boolean [read-only]
Indicates if the left drawer is currently docked. | Drawers | ||
isLeftDrawerOpen : Boolean
Indicates if the left drawer is currently open. | Drawers | ||
![]() | isQuickHitAreaEnabled : Boolean
Similar to mouseChildren on the classic display list. | FeathersControl | |
isRightDrawerDocked : Boolean [read-only]
Indicates if the right drawer is currently docked. | Drawers | ||
isRightDrawerOpen : Boolean
Indicates if the right drawer is currently open. | Drawers | ||
isTopDrawerDocked : Boolean [read-only]
Indicates if the top drawer is currently docked. | Drawers | ||
isTopDrawerOpen : Boolean
Indicates if the top drawer is currently open. | Drawers | ||
![]() | layoutData : ILayoutData
Extra parameters associated with this display object that will be
used by the layout algorithm. | FeathersControl | |
leftDrawer : DisplayObject
The drawer that appears below the primary content. | Drawers | ||
leftDrawerDockMode : String
Determines if the left drawer is docked in all, some, or no stage
orientations. | Drawers | ||
leftDrawerToggleEventType : String
When this event is dispatched by the content event dispatcher, the
left drawer will toggle open and closed. | Drawers | ||
![]() | maxHeight : Number
The maximum recommended height to be used for self-measurement and,
optionally, by any code that is resizing this component. | FeathersControl | |
![]() | maxWidth : Number
The maximum recommended width to be used for self-measurement and,
optionally, by any code that is resizing this component. | FeathersControl | |
![]() | minHeight : Number
The minimum recommended height to be used for self-measurement and,
optionally, by any code that is resizing this component. | FeathersControl | |
minimumDragDistance : Number
The minimum physical distance (in inches) that a touch must move
before a drag gesture begins. | Drawers | ||
minimumDrawerThrowVelocity : Number
The minimum physical velocity (in inches per second) that a touch
must move before the a drawern can be "thrown" to open or close it. | Drawers | ||
![]() | minTouchHeight : Number
If using isQuickHitAreaEnabled, and the hit area's
height is smaller than this value, it will be expanded. | FeathersControl | |
![]() | minTouchWidth : Number
If using isQuickHitAreaEnabled, and the hit area's
width is smaller than this value, it will be expanded. | FeathersControl | |
![]() | minWidth : Number
The minimum recommended width to be used for self-measurement and,
optionally, by any code that is resizing this component. | FeathersControl | |
![]() | nextTabFocus : IFocusDisplayObject | FeathersControl | |
openGesture : String
An optional touch gesture used to open a drawer. | Drawers | ||
openGestureEdgeSize : Number
The minimum physical distance (in inches) that a touch must move
before a drag gesture begins. | Drawers | ||
openOrCloseDuration : Number
The duration, in seconds, of the animation when a drawer opens or
closes. | Drawers | ||
openOrCloseEase : Object
The easing function used for opening or closing the drawers. | Drawers | ||
overlaySkin : DisplayObject
An optional display object that appears above the content when a
drawer is open. | Drawers | ||
![]() | previousTabFocus : IFocusDisplayObject | FeathersControl | |
rightDrawer : DisplayObject
The drawer that appears to the right of the primary content. | Drawers | ||
rightDrawerDockMode : String
Determines if the right drawer is docked in all, some, or no stage
orientations. | Drawers | ||
rightDrawerToggleEventType : String
When this event is dispatched by the content event dispatcher, the
right drawer will toggle open and closed. | Drawers | ||
![]() | styleName : String
The concatenated styleNameList, with values separated
by spaces. | FeathersControl | |
![]() | styleNameList : TokenList [read-only]
Contains a list of all "styles" assigned to this control. | FeathersControl | |
![]() | styleProvider : IStyleProvider
When a component initializes, a style provider may be used to set
properties that affect the component's visual appearance. | FeathersControl | |
topDrawer : DisplayObject
The drawer that appears above the primary content. | Drawers | ||
topDrawerDockMode : String
Determines if the top drawer is docked in all, some, or no stage
orientations. | Drawers | ||
topDrawerToggleEventType : String
When this event is dispatched by the content event dispatcher, the
top drawer will toggle open and closed. | Drawers | ||
![]() | width : Number [override]
The width of the component, in pixels. | FeathersControl |
Property | Defined By | ||
---|---|---|---|
![]() | actualHeight : Number = 0
The final height value that should be used for layout. | FeathersControl | |
![]() | actualWidth : Number = 0
The final width value that should be used for layout. | FeathersControl | |
contentEventDispatcher : EventDispatcher
The event dispatcher that controls opening and closing drawers with
events. | Drawers | ||
![]() | defaultStyleProvider : IStyleProvider [read-only]
When the FeathersControl constructor is called, the
globalStyleProvider property is set to this value. | FeathersControl | |
![]() | explicitHeight : Number = NaN
The height value explicitly set by calling the height setter or
setSize(). | FeathersControl | |
![]() | explicitWidth : Number = NaN
The width value explicitly set by calling the width setter or
setSize(). | FeathersControl |
Method | Defined By | ||
---|---|---|---|
Drawers(content:DisplayObject = null)
Constructor. | Drawers | ||
![]() | hideFocus():void
If the visual indicator of focus has been displayed by
showFocus(), call this function to hide it. | FeathersControl | |
![]() | invalidate(flag:String):void
Call this function to tell the UI control that a redraw is pending. | FeathersControl | |
![]() | isInvalid(flag:String = null):Boolean
Indicates whether the control is pending validation or not. | FeathersControl | |
![]() | move(x:Number, y:Number):void
Sets both the x and the y positions of the control in a single
function call. | FeathersControl | |
![]() | setSize(width:Number, height:Number):void
Sets both the width and the height of the control in a single
function call. | FeathersControl | |
![]() | showFocus():void
If the object has focus, an additional visual indicator may
optionally be displayed to highlight the object. | FeathersControl | |
toggleBottomDrawer(duration:Number):void
Opens or closes the bottom drawer. | Drawers | ||
toggleLeftDrawer(duration:Number):void
Opens or closes the left drawer. | Drawers | ||
toggleRightDrawer(duration:Number):void
Opens or closes the right drawer. | Drawers | ||
toggleTopDrawer(duration:Number):void
Opens or closes the top drawer. | Drawers | ||
![]() | validate():void
Immediately validates the display object, if it is invalid. | FeathersControl |
Method | Defined By | ||
---|---|---|---|
autoSizeIfNeeded():Boolean
If the component's dimensions have not been set explicitly, it will
measure its content and determine an ideal size for itself. | Drawers | ||
![]() | clearInvalidationFlag(flag:String):void
Clears an invalidation flag. | FeathersControl | |
contentToContentEventDispatcher():EventDispatcher
Uses the content event dispatcher fields and functions to generate a
content event dispatcher icon for the content. | Drawers | ||
![]() | draw():void
Override to customize layout and to adjust properties of children. | FeathersControl | |
![]() | focusInHandler(event:Event):void
Default event handler for FeathersEventType.FOCUS_IN
that may be overridden in subclasses to perform additional actions
when the component receives focus. | FeathersControl | |
![]() | focusOutHandler(event:Event):void
Default event handler for FeathersEventType.FOCUS_OUT
that may be overridden in subclasses to perform additional actions
when the component loses focus. | FeathersControl | |
![]() | initialize():void
Called the first time that the UI control is added to the stage, and
you should override this function to customize the initialization
process. | FeathersControl | |
layoutChildren():void
Positions and sizes the children. | Drawers | ||
![]() | refreshFocusIndicator():void
Updates the focus indicator skin by showing or hiding it and
adjusting its position and dimensions. | FeathersControl | |
![]() | setInvalidationFlag(flag:String):void
Sets an invalidation flag. | FeathersControl | |
![]() | setSizeInternal(width:Number, height:Number, canInvalidate:Boolean):Boolean
Sets the width and height of the control, with the option of
invalidating or not. | FeathersControl |
Event | Summary | Defined By | ||
---|---|---|---|---|
Dispatched when the user starts dragging the content to open or close a drawer. | Drawers | |||
Dispatched when a drawer has completed closing. | Drawers | |||
![]() | Dispatched after the component has validated for the first time. | FeathersControl | ||
Dispatched when the user stops dragging the content to open or close a drawer. | Drawers | |||
![]() | Dispatched after initialize() has been called, but before the first time that draw() has been called. | FeathersControl | ||
Dispatched when a drawer has completed opening. | Drawers | |||
![]() | Dispatched when the width or height of the control changes. | FeathersControl |
Constant | Defined By | ||
---|---|---|---|
AUTO_SIZE_MODE_CONTENT : String = content [static]
The drawers container will auto size itself to fit its content. | Drawers | ||
AUTO_SIZE_MODE_STAGE : String = stage [static]
The drawers container will auto size itself to fill the entire stage. | Drawers | ||
DOCK_MODE_BOTH : String = both [static]
The drawer will be docked in all orientations. | Drawers | ||
DOCK_MODE_LANDSCAPE : String = landscape [static]
The drawer will be docked in landscape orientation, but it must be
opened and closed explicitly in portrait orientation. | Drawers | ||
DOCK_MODE_NONE : String = none [static]
The drawer won't be docked in any orientation. | Drawers | ||
DOCK_MODE_PORTRAIT : String = portrait [static]
The drawer will be docked in portrait orientation, but it must be
opened and closed explicitly in landscape orientation. | Drawers | ||
![]() | INVALIDATION_FLAG_ALL : String = all [static]
Flag to indicate that everything is invalid and should be redrawn. | FeathersControl | |
![]() | INVALIDATION_FLAG_DATA : String = data [static]
Invalidation flag to indicate that the primary data displayed by the
UI control has changed. | FeathersControl | |
![]() | INVALIDATION_FLAG_FOCUS : String = focus [static]
Invalidation flag to indicate that the focus of the UI control has
changed. | FeathersControl | |
![]() | INVALIDATION_FLAG_LAYOUT : String = layout [static]
Invalidation flag to indicate that the layout of the UI control has
changed. | FeathersControl | |
![]() | INVALIDATION_FLAG_SCROLL : String = scroll [static]
Invalidation flag to indicate that the scroll position of the UI
control has changed. | FeathersControl | |
![]() | INVALIDATION_FLAG_SELECTED : String = selected [static]
Invalidation flag to indicate that the selection of the UI control
has changed. | FeathersControl | |
![]() | INVALIDATION_FLAG_SIZE : String = size [static]
Invalidation flag to indicate that the dimensions of the UI control
have changed. | FeathersControl | |
![]() | INVALIDATION_FLAG_SKIN : String = skin [static]
Invalidation flag to indicate that the skin of the UI control has changed. | FeathersControl | |
![]() | INVALIDATION_FLAG_STATE : String = state [static]
Invalidation flag to indicate that the state has changed. | FeathersControl | |
![]() | INVALIDATION_FLAG_STYLES : String = styles [static]
Invalidation flag to indicate that the styles or visual appearance of
the UI control has changed. | FeathersControl | |
OPEN_GESTURE_DRAG_CONTENT : String = dragContent [static]
A drawer will open by dragging the content from any location in the
appropriate direction. | Drawers | ||
OPEN_GESTURE_DRAG_CONTENT_EDGE : String = dragContentEdge [static]
A drawer will open by dragging the content starting from a certain
physical distance (in inches) from the nearest edge of the content. | Drawers | ||
OPEN_GESTURE_NONE : String = none [static]
The drawers container will only open using the toggle event types
dispatched by the content. | Drawers |
Constant | Defined By | ||
---|---|---|---|
SCREEN_NAVIGATOR_CONTENT_EVENT_DISPATCHER_FIELD : String = activeScreen [static]
The field used to access the "content event dispatcher" of a
ScreenNavigator component, which happens to be the
currently active screen. | Drawers |
autoSizeMode | property |
autoSizeMode:String
Determines how the drawers container will set its own size when its dimensions (width and height) aren't set explicitly.
In the following example, the drawers container will be sized to match its content:
drawers.autoSizeMode = Drawers.AUTO_SIZE_MODE_CONTENT;
The default value is Drawers.AUTO_SIZE_MODE_STAGE
.
public function get autoSizeMode():String
public function set autoSizeMode(value:String):void
See also
bottomDrawer | property |
bottomDrawer:DisplayObject
The drawer that appears below the primary content.
In the following example, a List
is added as the
bottom drawer:
var list:List = new List(); // set data provider and other properties here drawers.bottomDrawer = list;
The default value is null
.
public function get bottomDrawer():DisplayObject
public function set bottomDrawer(value:DisplayObject):void
See also
bottomDrawerDockMode | property |
bottomDrawerDockMode:String
Determines if the bottom drawer is docked in all, some, or no stage orientations. The current stage orientation is determined by calculating the aspect ratio of the stage.
In the following example, the bottom drawer is docked in the landscape stage orientation:
drawers.bottomDrawerDockMode = Drawers.DOCK_MODE_LANDSCAPE;
The default value is Drawers.DOCK_MODE_NONE
.
public function get bottomDrawerDockMode():String
public function set bottomDrawerDockMode(value:String):void
See also
bottomDrawerToggleEventType | property |
bottomDrawerToggleEventType:String
When this event is dispatched by the content event dispatcher, the bottom drawer will toggle open and closed.
In the following example, the bottom drawer is toggled when the
content dispatches an event of type Event.OPEN
:
drawers.bottomDrawerToggleEventType = Event.OPEN;
The default value is null
.
public function get bottomDrawerToggleEventType():String
public function set bottomDrawerToggleEventType(value:String):void
See also
clipDrawers | property |
clipDrawers:Boolean
Determines if the drawers are clipped while opening or closing. If the content does not have a background, the drawers should generally be clipped so that the drawer does not show under the content. If the content has a fully opaque background that will conceal the drawers, then clipping may be disabled to potentially improve performance.
In the following example, clipping will be disabled:
navigator.clipDrawers = false;
The default value is true
.
public function get clipDrawers():Boolean
public function set clipDrawers(value:Boolean):void
See also
content | property |
content:DisplayObject
The primary content displayed in the center of the container.
If the primary content is a container where you'd prefer to listen
to events from its children, you may need to use properties like
contentEventDispatcherField
, contentEventDispatcherFunction
,
and contentEventDispatcherChangeEventType
to ensure that
open and close events for drawers are correctly mapped to the correct
event dispatcher. If the content is dispatching the events, then those
properties should be set to null
.
In the following example, a ScreenNavigator
is added
as the content:
var navigator:ScreenNavigator = new ScreenNavigator(); // additional code to add the screens can go here drawers.content = navigator;
The default value is null
.
public function get content():DisplayObject
public function set content(value:DisplayObject):void
See also
contentEventDispatcher | property |
protected var contentEventDispatcher:EventDispatcher
The event dispatcher that controls opening and closing drawers with
events. Often, the event dispatcher is the content itself, but you
may specify a contentEventDispatcherField
to access a
property of the content instead, or you may specify a
contentEventDispatcherFunction
to run some more complex
code to access the event dispatcher.
See also
contentEventDispatcherChangeEventType | property |
contentEventDispatcherChangeEventType:String
The event dispatched by the content to indicate that the content
event dispatcher has changed. When this event is dispatched by the
content, the drawers container will listen for the drawer toggle
events from the new dispatcher that discovered using
contentEventDispatcherField
or
contentEventDispatcherFunction
.
For StackScreenNavigator
and
ScreenNavigator
components, this value is automatically
set to Event.CHANGE
.
In the following example, the drawers container will update its
content event dispatcher when the content dispatches an event of type
Event.CHANGE
:
drawers.contentEventDispatcherChangeEventType = Event.CHANGE;
The default value is null
.
public function get contentEventDispatcherChangeEventType():String
public function set contentEventDispatcherChangeEventType(value:String):void
See also
contentEventDispatcherField | property |
contentEventDispatcherField:String
A property of the content
that references an event
dispatcher that dispatches events to toggle drawers open and closed.
For StackScreenNavigator
and
ScreenNavigator
components, this value is automatically
set to "activeScreen"
to listen for events from the
currently active/visible screen.
In the following example, the content event dispatcher field is customized:
drawers.contentEventDispatcherField = "selectedChild";
The default value is null
.
public function get contentEventDispatcherField():String
public function set contentEventDispatcherField(value:String):void
See also
contentEventDispatcherFunction | property |
contentEventDispatcherFunction:Function
A function that returns an event dispatcher that dispatches events to toggle drawers open and closed.
The function is expected to have the following signature:
function( content:DisplayObject ):EventDispatcher
In the following example, the content event dispatcher function is customized:
drawers.contentEventDispatcherField = function( content:CustomView ):void { return content.selectedChild; };
The default value is null
.
public function get contentEventDispatcherFunction():Function
public function set contentEventDispatcherFunction(value:Function):void
See also
globalStyleProvider | property |
public static var globalStyleProvider:IStyleProvider
The default IStyleProvider
for all Drawers
components.
The default value is null
.
See also
isBottomDrawerDocked | property |
isBottomDrawerDocked:Boolean
[read-only]
Indicates if the bottom drawer is currently docked. Docking behavior of
the bottom drawer is controlled with the bottomDrawerDockMode
property. To check if the bottom drawer is open, but not docked, use
the isBottomDrawerOpen
property.
public function get isBottomDrawerDocked():Boolean
See also
isBottomDrawerOpen | property |
isBottomDrawerOpen:Boolean
Indicates if the bottom drawer is currently open. If you want to check
if the bottom drawer is docked, check isBottomDrawerDocked
instead.
To animate the bottom drawer open or closed, call
toggleBottomDrawer()
. Setting isBottomDrawerOpen
will open or close the bottom drawer without animation.
In the following example, we check if the bottom drawer is open:
if( drawers.isBottomDrawerOpen ) { // do something }
The default value is false
.
public function get isBottomDrawerOpen():Boolean
public function set isBottomDrawerOpen(value:Boolean):void
See also
isLeftDrawerDocked | property |
isLeftDrawerDocked:Boolean
[read-only]
Indicates if the left drawer is currently docked. Docking behavior of
the left drawer is controlled with the leftDrawerDockMode
property. To check if the left drawer is open, but not docked, use
the isLeftDrawerOpen
property.
public function get isLeftDrawerDocked():Boolean
See also
isLeftDrawerOpen | property |
isLeftDrawerOpen:Boolean
Indicates if the left drawer is currently open. If you want to check
if the left drawer is docked, check isLeftDrawerDocked
instead.
To animate the left drawer open or closed, call
toggleLeftDrawer()
. Setting isLeftDrawerOpen
will open or close the left drawer without animation.
In the following example, we check if the left drawer is open:
if( drawers.isLeftDrawerOpen ) { // do something }
The default value is false
.
public function get isLeftDrawerOpen():Boolean
public function set isLeftDrawerOpen(value:Boolean):void
See also
isRightDrawerDocked | property |
isRightDrawerDocked:Boolean
[read-only]
Indicates if the right drawer is currently docked. Docking behavior of
the right drawer is controlled with the rightDrawerDockMode
property. To check if the right drawer is open, but not docked, use
the isRightDrawerOpen
property.
public function get isRightDrawerDocked():Boolean
See also
isRightDrawerOpen | property |
isRightDrawerOpen:Boolean
Indicates if the right drawer is currently open. If you want to check
if the right drawer is docked, check isRightDrawerDocked
instead.
To animate the right drawer open or closed, call
toggleRightDrawer()
. Setting isRightDrawerOpen
will open or close the right drawer without animation.
In the following example, we check if the right drawer is open:
if( drawers.isRightDrawerOpen ) { // do something }
The default value is false
.
public function get isRightDrawerOpen():Boolean
public function set isRightDrawerOpen(value:Boolean):void
See also
isTopDrawerDocked | property |
isTopDrawerDocked:Boolean
[read-only]
Indicates if the top drawer is currently docked. Docking behavior of
the top drawer is controlled with the topDrawerDockMode
property. To check if the top drawer is open, but not docked, use
the isTopDrawerOpen
property.
public function get isTopDrawerDocked():Boolean
See also
isTopDrawerOpen | property |
isTopDrawerOpen:Boolean
Indicates if the top drawer is currently open. If you want to check
if the top drawer is docked, check isTopDrawerDocked
instead.
To animate the top drawer open or closed, call
toggleTopDrawer()
. Setting isTopDrawerOpen
will open or close the top drawer without animation.
In the following example, we check if the top drawer is open:
if( drawers.isTopDrawerOpen ) { // do something }
The default value is false
.
public function get isTopDrawerOpen():Boolean
public function set isTopDrawerOpen(value:Boolean):void
See also
leftDrawer | property |
leftDrawer:DisplayObject
The drawer that appears below the primary content.
In the following example, a List
is added as the
left drawer:
var list:List = new List(); // set data provider and other properties here drawers.leftDrawer = list;
The default value is null
.
public function get leftDrawer():DisplayObject
public function set leftDrawer(value:DisplayObject):void
See also
leftDrawerDockMode | property |
leftDrawerDockMode:String
Determines if the left drawer is docked in all, some, or no stage orientations. The current stage orientation is determined by calculating the aspect ratio of the stage.
In the following example, the left drawer is docked in the landscape stage orientation:
drawers.leftDrawerDockMode = Drawers.DOCK_MODE_LANDSCAPE;
The default value is Drawers.DOCK_MODE_NONE
.
public function get leftDrawerDockMode():String
public function set leftDrawerDockMode(value:String):void
See also
leftDrawerToggleEventType | property |
leftDrawerToggleEventType:String
When this event is dispatched by the content event dispatcher, the left drawer will toggle open and closed.
In the following example, the left drawer is toggled when the
content dispatches and event of type Event.OPEN
:
drawers.leftDrawerToggleEventType = Event.OPEN;
The default value is null
.
public function get leftDrawerToggleEventType():String
public function set leftDrawerToggleEventType(value:String):void
See also
minimumDragDistance | property |
minimumDragDistance:Number
The minimum physical distance (in inches) that a touch must move before a drag gesture begins.
In the following example, the minimum drag distance is customized:
scroller.minimumDragDistance = 0.1;
The default value is 0.04
.
public function get minimumDragDistance():Number
public function set minimumDragDistance(value:Number):void
minimumDrawerThrowVelocity | property |
minimumDrawerThrowVelocity:Number
The minimum physical velocity (in inches per second) that a touch must move before the a drawern can be "thrown" to open or close it. Otherwise, it will settle open or closed based on which state is closer when the touch ends.
In the following example, the minimum drawer throw velocity is customized:
scroller.minimumDrawerThrowVelocity = 2;
The default value is 5
.
public function get minimumDrawerThrowVelocity():Number
public function set minimumDrawerThrowVelocity(value:Number):void
openGesture | property |
openGesture:String
An optional touch gesture used to open a drawer.
In the following example, the drawers are opened by dragging anywhere inside the content:
drawers.openGesture = Drawers.OPEN_GESTURE_DRAG_CONTENT;
The default value is Drawers.OPEN_GESTURE_DRAG_CONTENT_EDGE
.
public function get openGesture():String
public function set openGesture(value:String):void
See also
openGestureEdgeSize | property |
openGestureEdgeSize:Number
The minimum physical distance (in inches) that a touch must move before a drag gesture begins.
In the following example, the open gesture edge size customized:
scroller.openGestureEdgeSize = 0.25;
The default value is 0.1
.
public function get openGestureEdgeSize():Number
public function set openGestureEdgeSize(value:Number):void
openOrCloseDuration | property |
openOrCloseDuration:Number
The duration, in seconds, of the animation when a drawer opens or closes.
In the following example, the duration of the animation that opens or closes a drawer is set to 500 milliseconds:
scroller.openOrCloseDuration = 0.5;
The default value is 0.25
.
public function get openOrCloseDuration():Number
public function set openOrCloseDuration(value:Number):void
See also
openOrCloseEase | property |
openOrCloseEase:Object
The easing function used for opening or closing the drawers.
In the following example, the ease of the animation that opens and closes a drawer is customized:
drawrs.openOrCloseEase = Transitions.EASE_IN_OUT;
The default value is starling.animation.Transitions.EASE_OUT
.
public function get openOrCloseEase():Object
public function set openOrCloseEase(value:Object):void
See also
overlaySkin | property |
overlaySkin:DisplayObject
An optional display object that appears above the content when a drawer is open.
In the following example, a Quad
is added as the
overlay skin:
var skin:Quad = new Quad( 10, 10, 0x000000 ); skin.alpha = 0.75; drawers.overlaySkin = skin;
The default value is null
.
public function get overlaySkin():DisplayObject
public function set overlaySkin(value:DisplayObject):void
rightDrawer | property |
rightDrawer:DisplayObject
The drawer that appears to the right of the primary content.
In the following example, a List
is added as the
right drawer:
var list:List = new List(); // set data provider and other properties here drawers.rightDrawer = list;
The default value is null
.
public function get rightDrawer():DisplayObject
public function set rightDrawer(value:DisplayObject):void
See also
rightDrawerDockMode | property |
rightDrawerDockMode:String
Determines if the right drawer is docked in all, some, or no stage orientations. The current stage orientation is determined by calculating the aspect ratio of the stage.
In the following example, the right drawer is docked in the landscape stage orientation:
drawers.rightDrawerDockMode = Drawers.DOCK_MODE_LANDSCAPE;
The default value is Drawers.DOCK_MODE_NONE
.
public function get rightDrawerDockMode():String
public function set rightDrawerDockMode(value:String):void
See also
rightDrawerToggleEventType | property |
rightDrawerToggleEventType:String
When this event is dispatched by the content event dispatcher, the right drawer will toggle open and closed.
In the following example, the right drawer is toggled when the
content dispatches an event of type Event.OPEN
:
drawers.rightDrawerToggleEventType = Event.OPEN;
The default value is null
.
public function get rightDrawerToggleEventType():String
public function set rightDrawerToggleEventType(value:String):void
See also
topDrawer | property |
topDrawer:DisplayObject
The drawer that appears above the primary content.
In the following example, a List
is added as the
top drawer:
var list:List = new List(); // set data provider and other properties here drawers.topDrawer = list;
The default value is null
.
public function get topDrawer():DisplayObject
public function set topDrawer(value:DisplayObject):void
See also
topDrawerDockMode | property |
topDrawerDockMode:String
Determines if the top drawer is docked in all, some, or no stage orientations. The current stage orientation is determined by calculating the aspect ratio of the stage.
In the following example, the top drawer is docked in the landscape stage orientation:
drawers.topDrawerDockMode = Drawers.DOCK_MODE_LANDSCAPE;
The default value is Drawers.DOCK_MODE_NONE
.
public function get topDrawerDockMode():String
public function set topDrawerDockMode(value:String):void
See also
topDrawerToggleEventType | property |
topDrawerToggleEventType:String
When this event is dispatched by the content event dispatcher, the top drawer will toggle open and closed.
In the following example, the top drawer is toggled when the
content dispatches an event of type Event.OPEN
:
drawers.topDrawerToggleEventType = Event.OPEN;
The default value is null
.
public function get topDrawerToggleEventType():String
public function set topDrawerToggleEventType(value:String):void
See also
Drawers | () | Constructor |
public function Drawers(content:DisplayObject = null)
Constructor.
Parameterscontent:DisplayObject (default = null )
|
autoSizeIfNeeded | () | method |
protected function autoSizeIfNeeded():Boolean
If the component's dimensions have not been set explicitly, it will
measure its content and determine an ideal size for itself. If the
explicitWidth
or explicitHeight
member
variables are set, those value will be used without additional
measurement. If one is set, but not the other, the dimension with the
explicit value will not be measured, but the other non-explicit
dimension will still need measurement.
Calls setSizeInternal()
to set up the
actualWidth
and actualHeight
member
variables used for layout.
Meant for internal use, and subclasses may override this function with a custom implementation.
ReturnsBoolean |
contentToContentEventDispatcher | () | method |
protected function contentToContentEventDispatcher():EventDispatcher
Uses the content event dispatcher fields and functions to generate a content event dispatcher icon for the content.
All of the content event dispatcher fields and functions, ordered by priority:
contentEventDispatcherFunction
contentEventDispatcherField
EventDispatcher |
See also
layoutChildren | () | method |
protected function layoutChildren():void
Positions and sizes the children.
toggleBottomDrawer | () | method |
public function toggleBottomDrawer(duration:Number):void
Opens or closes the bottom drawer. If the duration
argument
is NaN
, the default openOrCloseDuration
is
used. The default value of the duration
argument is
NaN
. Otherwise, this value is the duration of the
animation, in seconds.
To open or close the bottom drawer without animation, set the
isBottomDrawerOpen
property.
Parameters
duration:Number (default = NaN )
|
See also
toggleLeftDrawer | () | method |
public function toggleLeftDrawer(duration:Number):void
Opens or closes the left drawer. If the duration
argument
is NaN
, the default openOrCloseDuration
is
used. The default value of the duration
argument is
NaN
. Otherwise, this value is the duration of the
animation, in seconds.
To open or close the left drawer without animation, set the
isLeftDrawerOpen
property.
Parameters
duration:Number (default = NaN )
|
See also
toggleRightDrawer | () | method |
public function toggleRightDrawer(duration:Number):void
Opens or closes the right drawer. If the duration
argument
is NaN
, the default openOrCloseDuration
is
used. The default value of the duration
argument is
NaN
. Otherwise, this value is the duration of the
animation, in seconds.
To open or close the right drawer without animation, set the
isRightDrawerOpen
property.
Parameters
duration:Number (default = NaN )
|
See also
toggleTopDrawer | () | method |
public function toggleTopDrawer(duration:Number):void
Opens or closes the top drawer. If the duration
argument
is NaN
, the default openOrCloseDuration
is
used. The default value of the duration
argument is
NaN
. Otherwise, this value is the duration of the
animation, in seconds.
To open or close the top drawer without animation, set the
isTopDrawerOpen
property.
Parameters
duration:Number (default = NaN )
|
See also
beginInteraction | Event |
starling.events.Event
feathers.events.FeathersEventType.BEGIN_INTERACTION
Dispatched when the user starts dragging the content to open or close a drawer.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
data | null |
target | The Object that dispatched the event;
it is not always the Object listening for the event. Use the
currentTarget property to always access the Object
listening for the event. |
FeathersEventType.BEGIN_INTERACTION
event type is
used by many UI controls where a drag or other interaction happens
over time. An example is a Slider
control where the
user touches the thumb to begin dragging.
See also
close | Event |
starling.events.Event
starling.events.Event.CLOSE
Dispatched when a drawer has completed closing. The data
property of the event indicates which drawer was closed.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
data | The drawer that was closed. |
target | The Object that dispatched the event;
it is not always the Object listening for the event. Use the
currentTarget property to always access the Object
listening for the event. |
See also
endInteraction | Event |
starling.events.Event
feathers.events.FeathersEventType.END_INTERACTION
Dispatched when the user stops dragging the content to open or close a drawer. The drawer may continue opening or closing after this event is dispatched if the user interaction has also triggered an animation.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
data | null |
target | The Object that dispatched the event;
it is not always the Object listening for the event. Use the
currentTarget property to always access the Object
listening for the event. |
FeathersEventType.END_INTERACTION
event type is
used by many UI controls where a drag or other interaction happens
over time. An example is a Slider
control where the
user stops touching the thumb after dragging.
Depending on the control, the result of the interaction may
continue after the interaction ends. For instance, a Scroller
may be "thrown", and the scrolling will continue animating after the
user has finished interacting with it.
See also
open | Event |
starling.events.Event
starling.events.Event.OPEN
Dispatched when a drawer has completed opening. The data
property of the event indicates which drawer is open.
The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
data | The drawer that was opened. |
target | The Object that dispatched the event;
it is not always the Object listening for the event. Use the
currentTarget property to always access the Object
listening for the event. |
See also
AUTO_SIZE_MODE_CONTENT | Constant |
public static const AUTO_SIZE_MODE_CONTENT:String = content
The drawers container will auto size itself to fit its content.
See also
AUTO_SIZE_MODE_STAGE | Constant |
public static const AUTO_SIZE_MODE_STAGE:String = stage
The drawers container will auto size itself to fill the entire stage.
See also
DOCK_MODE_BOTH | Constant |
public static const DOCK_MODE_BOTH:String = both
The drawer will be docked in all orientations.
See also
DOCK_MODE_LANDSCAPE | Constant |
public static const DOCK_MODE_LANDSCAPE:String = landscape
The drawer will be docked in landscape orientation, but it must be opened and closed explicitly in portrait orientation.
See also
DOCK_MODE_NONE | Constant |
public static const DOCK_MODE_NONE:String = none
The drawer won't be docked in any orientation. It must be opened and closed explicitly in all orientations.
See also
DOCK_MODE_PORTRAIT | Constant |
public static const DOCK_MODE_PORTRAIT:String = portrait
The drawer will be docked in portrait orientation, but it must be opened and closed explicitly in landscape orientation.
See also
OPEN_GESTURE_DRAG_CONTENT | Constant |
public static const OPEN_GESTURE_DRAG_CONTENT:String = dragContent
A drawer will open by dragging the content from any location in the appropriate direction.
See also
OPEN_GESTURE_DRAG_CONTENT_EDGE | Constant |
public static const OPEN_GESTURE_DRAG_CONTENT_EDGE:String = dragContentEdge
A drawer will open by dragging the content starting from a certain
physical distance (in inches) from the nearest edge of the content.
To customize this distance, use the openGestureDragContentEdgeDistance
property.
See also
OPEN_GESTURE_NONE | Constant |
public static const OPEN_GESTURE_NONE:String = none
The drawers container will only open using the toggle event types dispatched by the content. No gesture can be used to open a drawer.
See also
SCREEN_NAVIGATOR_CONTENT_EVENT_DISPATCHER_FIELD | Constant |
protected static const SCREEN_NAVIGATOR_CONTENT_EVENT_DISPATCHER_FIELD:String = activeScreen
The field used to access the "content event dispatcher" of a
ScreenNavigator
component, which happens to be the
currently active screen.
See also