Packageflare.vis.controls
Classpublic class HoverControl
InheritanceHoverControl Inheritance Control Inheritance flash.events.EventDispatcher

Interactive control for responding to mouse hover events. Select and deselect event listeners can be added to respond to mouse roll over and roll out, respectively.

This control also provides multiple policies on how the drawing order of items may be affected by a hover event. By default no changes are made (DONT_MOVE). The MOVE_TO_FRONT policy moves a hovered-over item to the end of its parent container's children list, such that it is drawn over its sibling items. Upon roll-out the item is left at the top of the list, such that the order of items partially reflects the order of mouse visits. The MOVE_AND_RETURN policy moves items to the top as well, but returns them to their original index upon roll-out.

See also

flare.vis.events.SelectionEvent


Public Properties
 PropertyDefined by
 Inheritedfilter : Function
Boolean function indicating the items considered by the control.
Control
  movePolicy : int
The policy for moving items forward when highlighted.
HoverControl
 Inheritedobject : InteractiveObject
The interactive object this control is attached to.
Control
Public Methods
 MethodDefined by
  
HoverControl(filter:* = null, movePolicy:int, rollOver:Function = null, rollOut:Function = null)
Creates a new HoverControl.
HoverControl
  
attach(obj:InteractiveObject):void
Attach this control to the given interactive object.
HoverControl
  
detach():InteractiveObject
Detach this control.
HoverControl
Events
 EventSummaryDefined by
  
add
 HoverControl
    HoverControl
Public Constants
 ConstantDefined by
  DONT_MOVE : int = 0
[static] Constant indicating that objects hovered over should not be moved within their parent container changed.
HoverControl
  MOVE_AND_RETURN : int = 2
[static] Constant indicating that objects hovered over should be moved to the front of their parent container and then returned to their previous position when the mouse rolls out.
HoverControl
  MOVE_TO_FRONT : int = 1
[static] Constant indicating that objects hovered over should be moved to the front of their parent container and kept there.
HoverControl
Property detail
movePolicyproperty
movePolicy:int  [read-write]

The policy for moving items forward when highlighted. One of DONT_MOVE, MOVE_TO_FRONT, or MOVE_AND_RETURN.

Implementation
    public function get movePolicy():int
    public function set movePolicy(value:int):void
Constructor detail
HoverControl()constructor
public function HoverControl(filter:* = null, movePolicy:int, rollOver:Function = null, rollOut:Function = null)

Creates a new HoverControl.

Parameters
filter:* (default = null) — a Boolean-valued filter function indicating which items should trigger hover processing
 
movePolicy:int — indicates which policy should be used for changing the z-ordering of hovered items. One of DONT_MOVE (the default), MOVE_TO_FRONT, or MOVE_AND_RETURN.
 
rollOver:Function (default = null) — an optional SelectionEvent listener for roll-overs
 
rollOut:Function (default = null) — an optional SelectionEvent listener for roll-outs
Method detail
attach()method
public override function attach(obj:InteractiveObject):void

Attach this control to the given interactive object. This method will automatically detach if already attached to another object.

Parameters
obj:InteractiveObject — the display object to attach to
detach()method 
public override function detach():InteractiveObject

Detach this control.

Returns
InteractiveObject — the interactive object this control was attached to, or null if this control was not attached.
Event detail
addevent 
Event object type: flare.vis.events.SelectionEvent

removeevent  
Event object type: flare.vis.events.SelectionEvent

Constant detail
DONT_MOVEconstant
public static const DONT_MOVE:int = 0

Constant indicating that objects hovered over should not be moved within their parent container changed.

MOVE_AND_RETURNconstant 
public static const MOVE_AND_RETURN:int = 2

Constant indicating that objects hovered over should be moved to the front of their parent container and then returned to their previous position when the mouse rolls out.

MOVE_TO_FRONTconstant 
public static const MOVE_TO_FRONT:int = 1

Constant indicating that objects hovered over should be moved to the front of their parent container and kept there.