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

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
  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
 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
 InheritedfocusIndicatorSkin : DisplayObject
If this component supports focus, this optional skin will be displayed above the component when showFocus() is called.
FeathersControl
 InheritedfocusManager : IFocusManager
FeathersControl
 InheritedfocusOwner : IFocusDisplayObject
FeathersControl
 InheritedfocusPadding : Number
Quickly sets all focus padding properties to the same value.
FeathersControl
 InheritedfocusPaddingBottom : Number
The minimum space, in pixels, between the object's bottom edge and the bottom edge of the focus indicator skin.
FeathersControl
 InheritedfocusPaddingLeft : Number
The minimum space, in pixels, between the object's left edge and the left edge of the focus indicator skin.
FeathersControl
 InheritedfocusPaddingRight : Number
The minimum space, in pixels, between the object's right edge and the right edge of the focus indicator skin.
FeathersControl
 InheritedfocusPaddingTop : 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
 Inheritedheight : Number
[override] The height of the component, in pixels.
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
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
  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 : 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
 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
 InheritednextTabFocus : 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
 InheritedpreviousTabFocus : 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
 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
  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
 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
 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 globalStyleProvider property is set to this value.
FeathersControl
 InheritedexplicitHeight : Number = NaN
The height value explicitly set by calling the height setter or setSize().
FeathersControl
 InheritedexplicitWidth : Number = NaN
The width value explicitly set by calling the width setter or setSize().
FeathersControl
Public Methods
 MethodDefined By
  
Drawers(content:DisplayObject = null)
Constructor.
Drawers
 Inherited
hideFocus():void
If the visual indicator of focus has been displayed by showFocus(), call this function to hide it.
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
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
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
 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
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
Updates the focus indicator skin by showing or hiding it and adjusting its position and dimensions.
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
Public Constants
 ConstantDefined 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
 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
  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
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 = Drawers.AUTO_SIZE_MODE_CONTENT;

The default value is Drawers.AUTO_SIZE_MODE_STAGE.


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

See also

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


Implementation
    public function get bottomDrawer():DisplayObject
    public function set bottomDrawer(value:DisplayObject):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 = Drawers.DOCK_MODE_LANDSCAPE;

The default value is Drawers.DOCK_MODE_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: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.


Implementation
    public function get content():DisplayObject
    public function set content(value:DisplayObject):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: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.


Implementation
    public function get leftDrawer():DisplayObject
    public function set leftDrawer(value:DisplayObject):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 = Drawers.DOCK_MODE_LANDSCAPE;

The default value is Drawers.DOCK_MODE_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:

         scroller.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:

         scroller.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 = Drawers.OPEN_GESTURE_DRAG_CONTENT;

The default value is Drawers.OPEN_GESTURE_DRAG_CONTENT_EDGE.


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

See also

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


Implementation
    public function get openGestureEdgeSize():Number
    public function set openGestureEdgeSize(value:Number):void
openOrCloseDurationproperty 
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.


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

See also

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


Implementation
    public function get openOrCloseEase():Object
    public function set openOrCloseEase(value:Object):void

See also

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


Implementation
    public function get overlaySkin():DisplayObject
    public function set overlaySkin(value:DisplayObject):void
rightDrawerproperty 
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.


Implementation
    public function get rightDrawer():DisplayObject
    public function set rightDrawer(value:DisplayObject):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 = Drawers.DOCK_MODE_LANDSCAPE;

The default value is Drawers.DOCK_MODE_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: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.


Implementation
    public function get topDrawer():DisplayObject
    public function set topDrawer(value:DisplayObject):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 = Drawers.DOCK_MODE_LANDSCAPE;

The default value is Drawers.DOCK_MODE_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:DisplayObject = null)

Constructor.

Parameters
content:DisplayObject (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 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.

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

Constant Detail
AUTO_SIZE_MODE_CONTENTConstant
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_STAGEConstant 
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_BOTHConstant 
public static const DOCK_MODE_BOTH:String = both

The drawer will be docked in all orientations.

See also

DOCK_MODE_LANDSCAPEConstant 
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_NONEConstant 
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_PORTRAITConstant 
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_CONTENTConstant 
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_EDGEConstant 
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

openGesture
openGestureEdgeSize
OPEN_GESTURE_NONEConstant 
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_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