Packagefeathers.core
Interfacepublic interface IFocusDisplayObject extends IFeathersDisplayObject, IFeathersEventDispatcher
Implementors Button, PickerList, Scroller, Slider, TabBar, ToggleSwitch

Product Version : Feathers 1.1.0

A component that can receive focus if a focus manager is enabled.

See also

Keyboard focus management in Feathers


Public Properties
 PropertyDefined By
 Inheritedalpha : Number
The opacity of the display object.
IFeathersDisplayObject
 Inheritedbase : DisplayObject
[read-only] The top-most object of the display tree that the display object is connected to.
IFeathersDisplayObject
 InheritedblendMode : String
The blend mode used when rendering the display object.
IFeathersDisplayObject
 Inheritedbounds : Rectangle
[read-only] The bounds of the display object in its local coordinate space.
IFeathersDisplayObject
 Inheritedfilter : FragmentFilter
The filter used when rendering the display object.
IFeathersDisplayObject
  focusManager : IFocusManager
The current focus manager for this component.
IFocusDisplayObject
  focusOwner : IFocusDisplayObject
Used for associating focusable display objects that are not direct children with an "owner" focusable display object, such as pop-ups.
IFocusDisplayObject
 Inheritedheight : Number
The height of the display object in the parent's coordinate space.
IFeathersDisplayObject
  isFocusEnabled : Boolean
Determines if this component can receive focus.
IFocusDisplayObject
  isShowingFocus : Boolean
[read-only] Indicates if the showFocus() method has been called on the object when it has focus.
IFocusDisplayObject
  maintainTouchFocus : Boolean
[read-only] If true, the display object should remain in focus, even if something else is touched.
IFocusDisplayObject
 Inheritedmask : DisplayObject
The display object's mask.
IFeathersDisplayObject
 Inheritedname : String
The name of the display object.
IFeathersDisplayObject
  nextDownFocus : IFocusDisplayObject
The next object that will receive focus when Keyboard.DOWN is pressed at KeyLocation.D_PAD and a focus manager is enabled.
IFocusDisplayObject
  nextLeftFocus : IFocusDisplayObject
The next object that will receive focus when Keyboard.LEFT is pressed at KeyLocation.D_PAD and a focus manager is enabled.
IFocusDisplayObject
  nextRightFocus : IFocusDisplayObject
The next object that will receive focus when Keyboard.RIGHT is pressed at KeyLocation.D_PAD and a focus manager is enabled.
IFocusDisplayObject
  nextTabFocus : IFocusDisplayObject
The next object that will receive focus when the tab key is pressed when a focus manager is enabled.
IFocusDisplayObject
  nextUpFocus : IFocusDisplayObject
The next object that will receive focus when Keyboard.UP is pressed at KeyLocation.D_PAD and a focus manager is enabled.
IFocusDisplayObject
 Inheritedparent : DisplayObjectContainer
[read-only] The display object's parent, or null if it doesn't have a parent.
IFeathersDisplayObject
 InheritedpivotX : Number
The x coordinate of the display object's origin in its own coordinate space.
IFeathersDisplayObject
 InheritedpivotY : Number
The y coordinate of the display object's origin in its own coordinate space.
IFeathersDisplayObject
  previousTabFocus : IFocusDisplayObject
The previous object that will receive focus when the tab key is pressed while holding shift when a focus manager is enabled.
IFocusDisplayObject
 Inheritedroot : DisplayObject
[read-only]
IFeathersDisplayObject
 Inheritedrotation : Number
The rotation of the display object, in radians.
IFeathersDisplayObject
 InheritedscaleX : Number
This horizontal scale factor.
IFeathersDisplayObject
 InheritedscaleY : Number
The vertical scale factor.
IFeathersDisplayObject
 InheritedskewX : Number
The horizontal skew, in radians.
IFeathersDisplayObject
 InheritedskewY : Number
The vertical skew, in radians.
IFeathersDisplayObject
 Inheritedstage : Stage
[read-only] The stage that the display object is connected to, or null if it is not connected to a stage.
IFeathersDisplayObject
 Inheritedtouchable : Boolean
Determines if the display object may be touched.
IFeathersDisplayObject
 InheritedtransformationMatrix : Matrix
[read-only] The transformation matrix of the display object, relative to its parent.
IFeathersDisplayObject
 InheriteduseHandCursor : Boolean
Determines if the mouse cursor should turn into a hand when the mouse is over the display object.
IFeathersDisplayObject
 Inheritedvisible : Boolean
Determines the visibility of the display object.
IFeathersDisplayObject
 Inheritedwidth : Number
The width of the display object in the parent's coordinate space.
IFeathersDisplayObject
 Inheritedx : Number
The x, or horizontal, position of the display object in the parent's coordinate space.
IFeathersDisplayObject
 Inheritedy : Number
The y, or vertical, position of the display object in the parent's coordinate space.
IFeathersDisplayObject
Public Methods
 MethodDefined By
 Inherited
addEventListener(type:String, listener:Function):void
Adds a listener for an event type.
IFeathersEventDispatcher
 Inherited
dispatchEvent(event:Event):void
Dispatches an event to all listeners added for the specified event type.
IFeathersEventDispatcher
 Inherited
dispatchEventWith(type:String, bubbles:Boolean = false, data:Object = null):void
Dispatches an event from the pool with the specified to all listeners for the specified event type.
IFeathersEventDispatcher
 Inherited
dispose():void
Disposes the display object.
IFeathersDisplayObject
 Inherited
getBounds(targetSpace:DisplayObject, resultRect:Rectangle = null):Rectangle
Gets the display object's bounds in the target coordinate space.
IFeathersDisplayObject
 Inherited
getTransformationMatrix(targetSpace:DisplayObject, resultMatrix:Matrix = null):Matrix
Calculates a transformation matrix to convert values from the display object's coordinate space to a target coordinate space.
IFeathersDisplayObject
 Inherited
globalToLocal(globalPoint:Point, resultPoint:Point = null):Point
Converts a point from the stage's coordinate space to the display object's coordinate space.
IFeathersDisplayObject
 Inherited
hasEventListener(type:String, listener:Function = null):Boolean
Checks if a listener has been added for the specified event type.
IFeathersEventDispatcher
  
hideFocus():void
If the visual indicator of focus has been displayed by showFocus(), call this function to hide it.
IFocusDisplayObject
 Inherited
hitTest(localPoint:Point):DisplayObject
Determines if a point exists within the display object's bounds.
IFeathersDisplayObject
 Inherited
localToGlobal(localPoint:Point, resultPoint:Point = null):Point
Converts a point from the display object's coordinate space to the stage's coordinate space.
IFeathersDisplayObject
 Inherited
removeEventListener(type:String, listener:Function):void
Removes a listener for an event type.
IFeathersEventDispatcher
 Inherited
removeEventListeners(type:String = null):void
Removes all listeners for an event type.
IFeathersEventDispatcher
 Inherited
removeFromParent(dispose:Boolean = false):void
Removes a display object from its parent.
IFeathersDisplayObject
 Inherited
render(painter:Painter):void
Renders the display object.
IFeathersDisplayObject
  
showFocus():void
If the object has focus, an additional visual indicator may optionally be displayed to highlight the object.
IFocusDisplayObject
Events
 Event Summary Defined By
  Dispatched when the display object receives focus.IFocusDisplayObject
  Dispatched when the display object loses focus.IFocusDisplayObject
Property Detail
focusManagerproperty
focusManager:IFocusManager

The current focus manager for this component. May be null if no focus manager is enabled.


Implementation
    public function get focusManager():IFocusManager
    public function set focusManager(value:IFocusManager):void
focusOwnerproperty 
focusOwner:IFocusDisplayObject

Used for associating focusable display objects that are not direct children with an "owner" focusable display object, such as pop-ups. A focus manager may use this property to influence the tab order.

In the following example, the focus owner is changed:

object.focusOwner = otherObject;


Implementation
    public function get focusOwner():IFocusDisplayObject
    public function set focusOwner(value:IFocusDisplayObject):void
isFocusEnabledproperty 
isFocusEnabled:Boolean

Determines if this component can receive focus.

In the following example, the focus is disabled:

object.isFocusEnabled = false;


Implementation
    public function get isFocusEnabled():Boolean
    public function set isFocusEnabled(value:Boolean):void
isShowingFocusproperty 
isShowingFocus:Boolean  [read-only]

Indicates if the showFocus() method has been called on the object when it has focus.

if(object.isShowingFocus)
{

}


Implementation
    public function get isShowingFocus():Boolean

See also

maintainTouchFocusproperty 
maintainTouchFocus:Boolean  [read-only]

If true, the display object should remain in focus, even if something else is touched. If false, touching another object will pass focus normally.


Implementation
    public function get maintainTouchFocus():Boolean
nextDownFocusproperty 
nextDownFocus:IFocusDisplayObject

Product Version : Feathers 3.4.0

The next object that will receive focus when Keyboard.DOWN is pressed at KeyLocation.D_PAD and a focus manager is enabled. If null, defaults to the best available child, as determined by the focus manager.

In the following example, the next down focus is changed:

object.nextDownFocus = otherObject;

To simulate KeyLocation.D_PAD in the AIR Debug Launcher on desktop for debugging purposes, set DeviceCapabilities.simulateDPad to true.


Implementation
    public function get nextDownFocus():IFocusDisplayObject
    public function set nextDownFocus(value:IFocusDisplayObject):void

See also

nextLeftFocusproperty 
nextLeftFocus:IFocusDisplayObject

Product Version : Feathers 3.4.0

The next object that will receive focus when Keyboard.LEFT is pressed at KeyLocation.D_PAD and a focus manager is enabled. If null, defaults to the best available child, as determined by the focus manager.

In the following example, the next left focus is changed:

object.nextLeftFocus = otherObject;

To simulate KeyLocation.D_PAD in the AIR Debug Launcher on desktop for debugging purposes, set DeviceCapabilities.simulateDPad to true.


Implementation
    public function get nextLeftFocus():IFocusDisplayObject
    public function set nextLeftFocus(value:IFocusDisplayObject):void

See also

nextRightFocusproperty 
nextRightFocus:IFocusDisplayObject

Product Version : Feathers 3.4.0

The next object that will receive focus when Keyboard.RIGHT is pressed at KeyLocation.D_PAD and a focus manager is enabled. If null, defaults to the best available child, as determined by the focus manager.

In the following example, the next right focus is changed:

object.nextRightFocus = otherObject;

To simulate KeyLocation.D_PAD in the AIR Debug Launcher on desktop for debugging purposes, set DeviceCapabilities.simulateDPad to true.


Implementation
    public function get nextRightFocus():IFocusDisplayObject
    public function set nextRightFocus(value:IFocusDisplayObject):void

See also

nextTabFocusproperty 
nextTabFocus:IFocusDisplayObject

The next object that will receive focus when the tab key is pressed when a focus manager is enabled. If null, defaults to the next child on the display list.

In the following example, the next tab focus is changed:

object.nextTabFocus = otherObject;


Implementation
    public function get nextTabFocus():IFocusDisplayObject
    public function set nextTabFocus(value:IFocusDisplayObject):void
nextUpFocusproperty 
nextUpFocus:IFocusDisplayObject

Product Version : Feathers 3.4.0

The next object that will receive focus when Keyboard.UP is pressed at KeyLocation.D_PAD and a focus manager is enabled. If null, defaults to the best available child, as determined by the focus manager.

In the following example, the next up focus is changed:

object.nextUpFocus = otherObject;

To simulate KeyLocation.D_PAD in the AIR Debug Launcher on desktop for debugging purposes, set DeviceCapabilities.simulateDPad to true.


Implementation
    public function get nextUpFocus():IFocusDisplayObject
    public function set nextUpFocus(value:IFocusDisplayObject):void

See also

previousTabFocusproperty 
previousTabFocus:IFocusDisplayObject

The previous object that will receive focus when the tab key is pressed while holding shift when a focus manager is enabled. If null, defaults to the previous child on the display list.

In the following example, the previous tab focus is changed:

object.previousTabFocus = otherObject;


Implementation
    public function get previousTabFocus():IFocusDisplayObject
    public function set previousTabFocus(value:IFocusDisplayObject):void
Method Detail
hideFocus()method
public function hideFocus():void

If the visual indicator of focus has been displayed by showFocus(), call this function to hide it.

Important: This function will not clear focus from the display object if it has focus. To clear focus from the display object, you should set the focus property on the focus manager to null or another display object.

See also

showFocus()method 
public function showFocus():void

If the object has focus, an additional visual indicator may optionally be displayed to highlight the object. Calling this function may have no effect. It's merely a suggestion to the object.

Important: This function will not give focus to the display object if it doesn't have focus. To give focus to the display object, you should set the focus property on the focus manager.

object.focusManager.focus = object;

See also

Event Detail
focusIn Event
Event Object Type: starling.events.Event
Event.type property = feathers.events.FeathersEventType.FOCUS_IN

Dispatched when the display object receives focus.

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.FOCUS_IN event type is used by Feathers components to indicate when they have received focus.
focusOut Event  
Event Object Type: starling.events.Event
Event.type property = feathers.events.FeathersEventType.FOCUS_OUT

Dispatched when the display object loses focus.

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.FOCUS_OUT event type is used by Feathers components to indicate when they have lost focus.