Packagefeathers.controls
Classpublic class Drawers
InheritanceDrawers Inheritance FeathersControl Inheritance starling.display.Sprite

Product Version : Feathers 1.2.0

A container that displays primary content in the center surrounded by optional "drawers" that can open and close on the edges. Useful for mobile-style app menus that slide open from the side of the screen.

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

How to use the Feathers Drawers component


Public Properties
 PropertyDefined By
 InheritedaddedEffect : Function
An optional effect that is activated when the component is added to the stage.
FeathersControl
  autoSizeMode : String
Determines how the drawers container will set its own size when its dimensions (width and height) aren't set explicitly.
Drawers
  bottomDrawer : IFeathersControl
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 : IFeathersControl
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
 InheriteddefaultTextEditorFactory : Function
[static] A function used by all UI controls that support text editor to create an ITextEditor instance.
FeathersControl
 InheriteddefaultTextRendererFactory : Function
[static] A function used by all UI controls that support text renderers to create an ITextRenderer instance.
FeathersControl
 Inheriteddepth : int
[read-only] The component's depth in the display list, relative to the stage.
FeathersControl
 InheritedeffectsSuspended : Boolean
[read-only] Indicates if effects have been suspended.
FeathersControl
 InheritedexplicitHeight : Number
[read-only] The height value explicitly set by passing a value to the height setter or by calling the setSize() function.
FeathersControl
 InheritedexplicitMaxHeight : Number
[read-only] The maximum height value explicitly set by passing a value to the maxHeight setter.
FeathersControl
 InheritedexplicitMaxWidth : Number
[read-only] The maximum width value explicitly set by passing a value to the maxWidth setter.
FeathersControl
 InheritedexplicitMinHeight : Number
[read-only] The minimum height value explicitly set by passing a value to the minHeight setter.
FeathersControl
 InheritedexplicitMinWidth : Number
[read-only] The minimum width value explicitly set by passing a value to the minWidth setter.
FeathersControl
 InheritedexplicitWidth : Number
[read-only] The width value explicitly set by passing a value to the width setter or to the setSize() method.
FeathersControl
 InheritedfocusInEffect : Function
An optional effect that is activated when the component receives focus.
FeathersControl
 InheritedfocusManager : IFocusManager
The implementation of this property is provided for convenience, but it cannot be used unless a subclass implements the IFocusDisplayObject interface. The current focus manager for this component.
FeathersControl
 InheritedfocusOutEffect : Function
An optional effect that is activated when the component loses focus.
FeathersControl
 InheritedfocusOwner : IFocusDisplayObject
The implementation of this property is provided for convenience, but it cannot be used unless a subclass implements the IFocusDisplayObject interface. Used for associating focusable display objects that are not direct children with an "owner" focusable display object, such as pop-ups.
FeathersControl
  globalStyleProvider : IStyleProvider
[static] The default IStyleProvider for all Drawers components.
Drawers
 Inheritedheight : Number
[override] The height of the component, in pixels.
FeathersControl
 InheritedhideEffect : Function
An optional effect that is activated when the component is hidden.
FeathersControl
 InheritedincludeInLayout : 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
 InheritedisCreated : Boolean
[read-only] Determines if the component has been initialized and validated for the first time.
FeathersControl
 InheritedisEnabled : Boolean
Indicates whether the control is interactive or not.
FeathersControl
 InheritedisFocusEnabled : Boolean
The implementation of this property is provided for convenience, but it cannot be used unless a subclass implements the IFocusDisplayObject interface. Determines if this component can receive focus.
FeathersControl
 InheritedisInitialized : 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
 InheritedisQuickHitAreaEnabled : 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
 InheritedisShowingFocus : Boolean
[read-only] The implementation of this method is provided for convenience, but it cannot be used unless a subclass implements the IFocusDisplayObject interface. Indicates if the showFocus() method has been called on the object when it has focus.
FeathersControl
  isTopDrawerDocked : Boolean
[read-only] Indicates if the top drawer is currently docked.
Drawers
  isTopDrawerOpen : Boolean
Indicates if the top drawer is currently open.
Drawers
 InheritedlayoutData : ILayoutData
Extra parameters associated with this display object that will be used by the layout algorithm.
FeathersControl
  leftDrawer : IFeathersControl
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
 InheritedmaintainTouchFocus : Boolean
[read-only] The implementation of this method is provided for convenience, but it cannot be used unless a subclass implements the IFocusDisplayObject interface. If true, the display object should remain in focus, even if something else is touched.
FeathersControl
 InheritedmaxHeight : Number
The maximum recommended height to be used for self-measurement and, optionally, by any code that is resizing this component.
FeathersControl
 InheritedmaxWidth : Number
The maximum recommended width to be used for self-measurement and, optionally, by any code that is resizing this component.
FeathersControl
 InheritedminHeight : 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
 InheritedminTouchHeight : Number
If using isQuickHitAreaEnabled, and the hit area's height is smaller than this value, it will be expanded.
FeathersControl
 InheritedminTouchWidth : Number
If using isQuickHitAreaEnabled, and the hit area's width is smaller than this value, it will be expanded.
FeathersControl
 InheritedminWidth : Number
The minimum recommended width to be used for self-measurement and, optionally, by any code that is resizing this component.
FeathersControl
 InheritedmoveEffect : Function
An optional effect that is activated when the component is moved to a new position.
FeathersControl
 InheritednextDownFocus : IFocusDisplayObject
The implementation of this property is provided for convenience, but it cannot be used unless a subclass implements the IFocusDisplayObject interface. The next object that will receive focus when Keyboard.DOWN is pressed at KeyLocation.D_PAD and a focus manager is enabled.
FeathersControl
 InheritednextLeftFocus : IFocusDisplayObject
The implementation of this property is provided for convenience, but it cannot be used unless a subclass implements the IFocusDisplayObject interface. The next object that will receive focus when Keyboard.LEFT is pressed at KeyLocation.D_PAD and a focus manager is enabled.
FeathersControl
 InheritednextRightFocus : IFocusDisplayObject
The implementation of this property is provided for convenience, but it cannot be used unless a subclass implements the IFocusDisplayObject interface. The next object that will receive focus when Keyboard.RIGHT is pressed at KeyLocation.D_PAD and a focus manager is enabled.
FeathersControl
 InheritednextTabFocus : IFocusDisplayObject
The implementation of this property is provided for convenience, but it cannot be used unless a subclass implements the IFocusDisplayObject interface. The next object that will receive focus when the tab key is pressed when a focus manager is enabled.
FeathersControl
 InheritednextUpFocus : IFocusDisplayObject
The implementation of this property is provided for convenience, but it cannot be used unless a subclass implements the IFocusDisplayObject interface. The next object that will receive focus when Keyboard.UP is pressed at KeyLocation.D_PAD and a focus manager is enabled.
FeathersControl
  openGesture : String
An optional touch gesture used to open a drawer.
Drawers
  openGestureEdgeSize : Number
The size (in inches) of the region near the edge of the content that can be dragged when the openGesture property is set to DragGesture.EDGE.
Drawers
 InheritedpreviousTabFocus : IFocusDisplayObject
The implementation of this property is provided for convenience, but it cannot be used unless a subclass implements the IFocusDisplayObject interface. The previous object that will receive focus when the tab key is pressed while holding shift when a focus manager is enabled.
FeathersControl
 InheritedresizeEffect : Function
An optional effect that is activated when the component is resized with new dimensions.
FeathersControl
  rightDrawer : IFeathersControl
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
 InheritedshowEffect : Function
An optional effect that is activated when the component is shown.
FeathersControl
 InheritedstyleName : String
The concatenated styleNameList, with values separated by spaces.
FeathersControl
 InheritedstyleNameList : TokenList
[read-only] Contains a list of all "styles" assigned to this control.
FeathersControl
 InheritedstyleProvider : IStyleProvider
When a component initializes, a style provider may be used to set properties that affect the component's visual appearance.
FeathersControl
 InheritedtoolTip : String
Text to display in a tool tip to when hovering over this component, if the ToolTipManager is enabled.
FeathersControl
  topDrawer : IFeathersControl
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
 Inheritedwidth : Number
[override] The width of the component, in pixels.
FeathersControl
Protected Properties
 PropertyDefined By
 InheritedactualHeight : Number = 0
The final height value that should be used for layout.
FeathersControl
 InheritedactualMinHeight : Number = 0
The final minimum height value that should be used for layout.
FeathersControl
 InheritedactualMinWidth : Number = 0
The final minimum width value that should be used for layout.
FeathersControl
 InheritedactualWidth : 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
 InheriteddefaultStyleProvider : IStyleProvider
[read-only] When the FeathersControl constructor is called, the styleProvider property is set to this value.
FeathersControl
Public Methods
 MethodDefined By
  
Drawers(content:IFeathersControl = null)
Constructor.
Drawers
 Inherited
getBounds(targetSpace:DisplayObject, resultRect:Rectangle = null):Rectangle
[override] Feathers components use an optimized getBounds() implementation that may sometimes behave differently than regular Starling display objects.
FeathersControl
 Inherited
hideFocus():void
The implementation of this method is provided for convenience, but it cannot be used unless a subclass implements the IFocusDisplayObject interface.
FeathersControl
 Inherited
If the component has not yet initialized, initializes immediately.
FeathersControl
 Inherited
invalidate(flag:String):void
Call this function to tell the UI control that a redraw is pending.
FeathersControl
 Inherited
isInvalid(flag:String = null):Boolean
Indicates whether the control is pending validation or not.
FeathersControl
 Inherited
move(x:Number, y:Number):void
Sets both the x and the y positions of the control in a single function call.
FeathersControl
 Inherited
removeFromParentWithEffect(effect:Function, dispose:Boolean = false):void
Plays an effect before removing the component from its parent.
FeathersControl
 Inherited
Resets the styleProvider property to its default value, which is usually the global style provider for the component.
FeathersControl
 Inherited
Indicates that effects should be re-activated after being suspended.
FeathersControl
 Inherited
setSize(width:Number, height:Number):void
Sets both the width and the height of the control in a single function call.
FeathersControl
 Inherited
showFocus():void
The implementation of this method is provided for convenience, but it cannot be used unless a subclass implements the IFocusDisplayObject interface.
FeathersControl
 Inherited
Indicates that effects should not be activated temporarily.
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
 Inherited
validate():void
Immediately validates the display object, if it is invalid.
FeathersControl
Protected Methods
 MethodDefined By
  
If the component's dimensions have not been set explicitly, it will measure its content and determine an ideal size for itself.
Drawers
 Inherited
clearInvalidationFlag(flag:String):void
Clears an invalidation flag.
FeathersControl
  
Uses the content event dispatcher fields and functions to generate a content event dispatcher icon for the content.
Drawers
 Inherited
draw():void
Override to customize layout and to adjust properties of children.
FeathersControl
 Inherited
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
 Inherited
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
 Inherited
The next style that is set will not be restricted.
FeathersControl
 Inherited
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
  
Positions and sizes the children.
Drawers
 Inherited
processStyleRestriction(key:Object):Boolean
Used by setters for properties that are considered "styles" to determine if the setter has been called directly on the component or from a style provider.
FeathersControl
 Inherited
Updates the focus indicator skin by showing or hiding it and adjusting its position and dimensions.
FeathersControl
 Inherited
saveMeasurements(width:Number, height:Number, minWidth:Number = 0, minHeight:Number = 0):Boolean
Saves the dimensions and minimum dimensions calculated for the component.
FeathersControl
 Inherited
setInvalidationFlag(flag:String):void
Sets an invalidation flag.
FeathersControl
 Inherited
setSizeInternal(width:Number, height:Number, canInvalidate:Boolean):Boolean
Sets the width and height of the control, with the option of invalidating or not.
FeathersControl
Events
 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
 InheritedDispatched 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
 InheritedDispatched after initialize() has been called, but before the first time that draw() has been called.FeathersControl
  Dispatched when a drawer has completed opening.Drawers
 InheritedDispatched when the width or height of the control changes.FeathersControl
Styles
 StyleDefined By
  
bottomDrawerDivider : DisplayObject
The divider between the bottom drawer and the content when the bottom drawer is docked.
Drawers
 Inherited
focusIndicatorSkin : DisplayObject
If this component supports focus, this optional skin will be displayed above the component when showFocus() is called.
FeathersControl
 Inherited
focusPadding : Number
Quickly sets all focus padding properties to the same value.
FeathersControl
 Inherited
The minimum space, in pixels, between the object's bottom edge and the bottom edge of the focus indicator skin.
FeathersControl
 Inherited
The minimum space, in pixels, between the object's left edge and the left edge of the focus indicator skin.
FeathersControl
 Inherited
The minimum space, in pixels, between the object's right edge and the right edge of the focus indicator skin.
FeathersControl
 Inherited
The minimum space, in pixels, between the object's top edge and the top edge of the focus indicator skin.
FeathersControl
  
leftDrawerDivider : DisplayObject
The divider between the left drawer and the content when the left drawer is docked.
Drawers
  
openMode : String
Determines whether the drawer opens above the content or below it.
Drawers
  
The duration, in seconds, of the animation when a drawer opens or closes.
Drawers
  
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
  
rightDrawerDivider : DisplayObject
The divider between the right drawer and the content when the right drawer is docked.
Drawers
  
topDrawerDivider : DisplayObject
The divider between the top drawer and the content when the top drawer is docked.
Drawers
Public Constants
 ConstantDefined By
 InheritedINVALIDATION_FLAG_ALL : String = "all"
[static] Flag to indicate that everything is invalid and should be redrawn.
FeathersControl
 InheritedINVALIDATION_FLAG_DATA : String = "data"
[static] Invalidation flag to indicate that the primary data displayed by the UI control has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_FOCUS : String = "focus"
[static] Invalidation flag to indicate that the focus of the UI control has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_LAYOUT : String = "layout"
[static] Invalidation flag to indicate that the layout of the UI control has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_SCROLL : String = "scroll"
[static] Invalidation flag to indicate that the scroll position of the UI control has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_SELECTED : String = "selected"
[static] Invalidation flag to indicate that the selection of the UI control has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_SIZE : String = "size"
[static] Invalidation flag to indicate that the dimensions of the UI control have changed.
FeathersControl
 InheritedINVALIDATION_FLAG_SKIN : String = "skin"
[static] Invalidation flag to indicate that the skin of the UI control has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_STATE : String = "state"
[static] Invalidation flag to indicate that the state has changed.
FeathersControl
 InheritedINVALIDATION_FLAG_STYLES : String = "styles"
[static] Invalidation flag to indicate that the styles or visual appearance of the UI control has changed.
FeathersControl
Protected Constants
 ConstantDefined 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
Property Detail
autoSizeModeproperty
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 = AutoSizeMode.CONTENT;

The default value is feathers.controls.AutoSizeMode.STAGE.


Implementation
    public function get autoSizeMode():String
    public function set autoSizeMode(value:String):void

See also

bottomDrawerproperty 
bottomDrawer:IFeathersControl

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.


Implementation
    public function get bottomDrawer():IFeathersControl
    public function set bottomDrawer(value:IFeathersControl):void

See also

bottomDrawerDockModeproperty 
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 = Orientation.LANDSCAPE;

The default value is feathers.layout.Orientation.NONE.


Implementation
    public function get bottomDrawerDockMode():String
    public function set bottomDrawerDockMode(value:String):void

See also

bottomDrawerToggleEventTypeproperty 
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.


Implementation
    public function get bottomDrawerToggleEventType():String
    public function set bottomDrawerToggleEventType(value:String):void

See also

clipDrawersproperty 
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.


Implementation
    public function get clipDrawers():Boolean
    public function set clipDrawers(value:Boolean):void

See also

contentproperty 
content:IFeathersControl

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 StackScreenNavigator is added as the content:

var navigator:StackScreenNavigator = new StackScreenNavigator();
// additional code to add the screens can go here
drawers.content = navigator;

The default value is null.


Implementation
    public function get content():IFeathersControl
    public function set content(value:IFeathersControl):void

See also

contentEventDispatcherproperty 
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

contentEventDispatcherChangeEventTypeproperty 
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.


Implementation
    public function get contentEventDispatcherChangeEventType():String
    public function set contentEventDispatcherChangeEventType(value:String):void

See also

contentEventDispatcherFieldproperty 
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.


Implementation
    public function get contentEventDispatcherField():String
    public function set contentEventDispatcherField(value:String):void

See also

contentEventDispatcherFunctionproperty 
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.


Implementation
    public function get contentEventDispatcherFunction():Function
    public function set contentEventDispatcherFunction(value:Function):void

See also

globalStyleProviderproperty 
public static var globalStyleProvider:IStyleProvider

The default IStyleProvider for all Drawers components.

The default value is null.

See also

isBottomDrawerDockedproperty 
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.


Implementation
    public function get isBottomDrawerDocked():Boolean

See also

isBottomDrawerOpenproperty 
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.


Implementation
    public function get isBottomDrawerOpen():Boolean
    public function set isBottomDrawerOpen(value:Boolean):void

See also

isLeftDrawerDockedproperty 
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.


Implementation
    public function get isLeftDrawerDocked():Boolean

See also

isLeftDrawerOpenproperty 
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.


Implementation
    public function get isLeftDrawerOpen():Boolean
    public function set isLeftDrawerOpen(value:Boolean):void

See also

isRightDrawerDockedproperty 
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.


Implementation
    public function get isRightDrawerDocked():Boolean

See also

isRightDrawerOpenproperty 
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.


Implementation
    public function get isRightDrawerOpen():Boolean
    public function set isRightDrawerOpen(value:Boolean):void

See also

isTopDrawerDockedproperty 
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.


Implementation
    public function get isTopDrawerDocked():Boolean

See also

isTopDrawerOpenproperty 
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.


Implementation
    public function get isTopDrawerOpen():Boolean
    public function set isTopDrawerOpen(value:Boolean):void

See also

leftDrawerproperty 
leftDrawer:IFeathersControl

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.


Implementation
    public function get leftDrawer():IFeathersControl
    public function set leftDrawer(value:IFeathersControl):void

See also

leftDrawerDockModeproperty 
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 = Orientation.LANDSCAPE;

The default value is feathers.layout.Orientation.NONE.


Implementation
    public function get leftDrawerDockMode():String
    public function set leftDrawerDockMode(value:String):void

See also

leftDrawerToggleEventTypeproperty 
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.


Implementation
    public function get leftDrawerToggleEventType():String
    public function set leftDrawerToggleEventType(value:String):void

See also

minimumDragDistanceproperty 
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:

drawers.minimumDragDistance = 0.1;

The default value is 0.04.


Implementation
    public function get minimumDragDistance():Number
    public function set minimumDragDistance(value:Number):void
minimumDrawerThrowVelocityproperty 
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:

drawers.minimumDrawerThrowVelocity = 2;

The default value is 5.


Implementation
    public function get minimumDrawerThrowVelocity():Number
    public function set minimumDrawerThrowVelocity(value:Number):void
openGestureproperty 
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 = DragGesture.CONTENT;

The default value is feathers.controls.DragGesture.EDGE.


Implementation
    public function get openGesture():String
    public function set openGesture(value:String):void

See also

openGestureEdgeSizeproperty 
openGestureEdgeSize:Number

The size (in inches) of the region near the edge of the content that can be dragged when the openGesture property is set to DragGesture.EDGE.

In the following example, the open gesture edge size is customized:

drawers.openGestureEdgeSize = 0.25;

The default value is 0.1.


Implementation
    public function get openGestureEdgeSize():Number
    public function set openGestureEdgeSize(value:Number):void

See also

rightDrawerproperty 
rightDrawer:IFeathersControl

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.


Implementation
    public function get rightDrawer():IFeathersControl
    public function set rightDrawer(value:IFeathersControl):void

See also

rightDrawerDockModeproperty 
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 = Orientation.LANDSCAPE;

The default value is feathers.layout.Orientation.NONE.


Implementation
    public function get rightDrawerDockMode():String
    public function set rightDrawerDockMode(value:String):void

See also

rightDrawerToggleEventTypeproperty 
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.


Implementation
    public function get rightDrawerToggleEventType():String
    public function set rightDrawerToggleEventType(value:String):void

See also

topDrawerproperty 
topDrawer:IFeathersControl

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.


Implementation
    public function get topDrawer():IFeathersControl
    public function set topDrawer(value:IFeathersControl):void

See also

topDrawerDockModeproperty 
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 = Orientation.LANDSCAPE;

The default value is feathers.layout.Orientation.NONE.


Implementation
    public function get topDrawerDockMode():String
    public function set topDrawerDockMode(value:String):void

See also

topDrawerToggleEventTypeproperty 
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.


Implementation
    public function get topDrawerToggleEventType():String
    public function set topDrawerToggleEventType(value:String):void

See also

Constructor Detail
Drawers()Constructor
public function Drawers(content:IFeathersControl = null)

Constructor.

Parameters
content:IFeathersControl (default = null)
Method Detail
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 saveMeasurements() 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.

Returns
Boolean
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:

  1. contentEventDispatcherFunction
  2. contentEventDispatcherField

Returns
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

Event Detail
beginInteraction Event
Event Object Type: starling.events.Event
Event.type property = 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:

PropertyValue
bubblesfalse
currentTargetThe 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.
datanull
targetThe 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.

The 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  
Event Object Type: starling.events.Event
Event.type property = 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:

PropertyValue
bubblesfalse
currentTargetThe 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.
dataThe drawer that was closed.
targetThe 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  
Event Object Type: starling.events.Event
Event.type property = 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:

PropertyValue
bubblesfalse
currentTargetThe 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.
datanull
targetThe 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.

The 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  
Event Object Type: starling.events.Event
Event.type property = 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:

PropertyValue
bubblesfalse
currentTargetThe 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.
dataThe drawer that was opened.
targetThe 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

Style Detail
topDrawerDividerstyle
topDrawerDivider:DisplayObject

The divider between the top drawer and the content when the top drawer is docked.

In the following example, a Quad is added as the top drawer divider:

var divider:Quad = new Quad( 2, 2, 0x999999 );
drawers.topDrawerDivider = quad;
drawers.topDrawerDockMode = Orientation.BOTH

The default value is null.

See also

rightDrawerDividerstyle 
rightDrawerDivider:DisplayObject

The divider between the right drawer and the content when the right drawer is docked.

In the following example, a Quad is added as the right drawer divider:

var divider:Quad = new Quad( 2, 2, 0x999999 );
drawers.rightDrawerDivider = quad;
drawers.rightDrawerDockMode = Orientation.BOTH

The default value is null.

See also

overlaySkinstyle 
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.

openOrCloseEasestyle 
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:

drawers.openOrCloseEase = Transitions.EASE_IN_OUT;

The default value is starling.animation.Transitions.EASE_OUT.

See also

openOrCloseDurationstyle 
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:

drawers.openOrCloseDuration = 0.5;

The default value is 0.25.

See also

openModestyle 
openMode:String

Determines whether the drawer opens above the content or below it.

In the following example, the drawers are opened above the content:

drawers.openMode = RelativeDepth.ABOVE;

The default value is feathers.layout.RelativeDepth#BELOW.

See also

leftDrawerDividerstyle 
leftDrawerDivider:DisplayObject

The divider between the left drawer and the content when the left drawer is docked.

In the following example, a Quad is added as the left drawer divider:

var divider:Quad = new Quad( 2, 2, 0x999999 );
drawers.leftDrawerDivider = quad;
drawers.leftDrawerDockMode = Orientation.BOTH

The default value is null.

See also

bottomDrawerDividerstyle 
bottomDrawerDivider:DisplayObject

The divider between the bottom drawer and the content when the bottom drawer is docked.

In the following example, a Quad is added as the bottom drawer divider:

var divider:Quad = new Quad( 2, 2, 0x999999 );
drawers.bottomDrawerDivider = quad;
drawers.bottomDrawerDockMode = Orientation.BOTH

The default value is null.

See also

Constant Detail
SCREEN_NAVIGATOR_CONTENT_EVENT_DISPATCHER_FIELDConstant
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