Packageflare.vis.controls
Classpublic class SelectionControl
InheritanceSelectionControl Inheritance Control Inheritance flash.events.EventDispatcher

Interactive control for selecting a group of objects by "rubber-banding" them with a rectangular section region.



Public Properties
 PropertyDefined by
  fillAlpha : Number = 0.2
Fill alpha of the selection region.
SelectionControl
  fillColor : uint = 0x8888FF
Fill color of the selection region.
SelectionControl
 Inheritedfilter : Function
Boolean function indicating the items considered by the control.
Control
  fireImmediately : Boolean = true
Indicates if a selection events should be fired immediately upon a chane of selection status (true) or after the mouse is released (false).
SelectionControl
  hitArea : InteractiveObject
The active hit area over which selection interactions can be performed.
SelectionControl
  lineAlpha : Number = 0.4
Line alpha of the selection region border.
SelectionControl
  lineColor : uint = 0x8888FF
Line color of the selection region border.
SelectionControl
  lineWidth : Number = 2
Line width of the selection region border.
SelectionControl
 Inheritedobject : InteractiveObject
The interactive object this control is attached to.
Control
Public Methods
 MethodDefined by
  
SelectionControl(filter:* = null, select:Function = null, deselect:Function = null, hitArea:InteractiveObject = null)
Creates a new SelectionControl.
SelectionControl
  
attach(obj:InteractiveObject):void
Attach this control to the given interactive object.
SelectionControl
  
detach():InteractiveObject
Detach this control.
SelectionControl
  
isSelected(d:DisplayObject):Boolean
Indicates is a display object has been selected.
SelectionControl
Events
 EventSummaryDefined by
    SelectionControl
    SelectionControl
Property detail
fillAlphaproperty
public var fillAlpha:Number = 0.2

Fill alpha of the selection region.

fillColorproperty 
public var fillColor:uint = 0x8888FF

Fill color of the selection region.

fireImmediatelyproperty 
public var fireImmediately:Boolean = true

Indicates if a selection events should be fired immediately upon a chane of selection status (true) or after the mouse is released (false). The default is true. Set this to false if immediate selections are causing any performance issues.

hitAreaproperty 
hitArea:InteractiveObject  [read-write]

The active hit area over which selection interactions can be performed.

Implementation
    public function get hitArea():InteractiveObject
    public function set hitArea(value:InteractiveObject):void
lineAlphaproperty 
public var lineAlpha:Number = 0.4

Line alpha of the selection region border.

lineColorproperty 
public var lineColor:uint = 0x8888FF

Line color of the selection region border.

lineWidthproperty 
public var lineWidth:Number = 2

Line width of the selection region border.

Constructor detail
SelectionControl()constructor
public function SelectionControl(filter:* = null, select:Function = null, deselect:Function = null, hitArea:InteractiveObject = null)

Creates a new SelectionControl.

Parameters
filter:* (default = null) — an optional Boolean-valued filter determining which items are eligible for selection.
 
select:Function (default = null) — a display object to use as the hit area for mouse events. For example, this could be a background region over which the selection can done. If this argument is null, the stage will be used.
 
deselect:Function (default = null) — an optional SelectionEvent listener for selections
 
hitArea:InteractiveObject (default = null) — an optional SelectionEvent listener for deselections
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.
isSelected()method 
public function isSelected(d:DisplayObject):Boolean

Indicates is a display object has been selected.

Parameters
d:DisplayObject — the display object

Returns
Boolean — true if selected, false if not
Event detail
deselectevent 
Event object type: flare.vis.events.SelectionEvent

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