Packagecom.senocular.display.transform
Classpublic class ControlInteractive
InheritanceControlInteractive Inheritance Control Inheritance flash.display.Sprite
Subclasses ControlHiddenMultifunction, ControlMove, ControlRegistration, ControlUV

Base class for interactive Transform Tool controls. This class adds to the Control class including a framework for handling user interaction through mouse events. updates. For non-interactive controls, use Control, though it is not required for controls to extend the Control class to be used as a control of the Transform Tool.



Public Properties
 PropertyDefined By
  cursor : Cursor
The cursor to be used when interacting with this control.
ControlInteractive
 InheritedfillAlpha : Number
The alpha of the color used for filled shapes in dynamically drawn control graphics.
Control
 InheritedfillColor : uint
The color to be used for filled shapes in dynamically drawn control graphics.
Control
 InheritedlineAlpha : Number
The alpha of the color used for outlines in dynamically drawn control graphics.
Control
 InheritedlineColor : uint
The color to be used for outlines in dynamically drawn control graphics.
Control
 InheritedlineThickness : Number
The thickness used for outlines in dynamically drawn control graphics.
Control
 Inheritedtool : TransformTool
A reference to the TransformTool instance the control was placed, defined in the ADDED_TO_STAGE event.
Control
Protected Properties
 PropertyDefined By
  activeLocalX : Number
Mouse location in x axis within the target object coordinate space while the control is being dragged.
ControlInteractive
  activeLocalY : Number
Mouse location in y axis within the target object coordinate space while the control is being dragged.
ControlInteractive
  activeMouseEvent : MouseEvent
The most recent mouse event received by the activeTarget dispatcher when consuming mouse events.
ControlInteractive
  activeTarget : IEventDispatcher
The object from which mouse events are consumed.
ControlInteractive
  activeX : Number
Mouse location in x axis within the Transform Tool coordinate space while the control is being dragged.
ControlInteractive
  activeY : Number
Mouse location in y axis within the Transform Tool coordinate space while the control is being dragged.
ControlInteractive
  baseLocalMatrixInverted : Matrix
Inverted base matrix used to convert locations in the Transform Tool coordinate space into locations within the target object coordinate space.
ControlInteractive
  baseLocalRegistration : Point
Registration point location within the target object coordinate space when the control is first clicked.
ControlInteractive
  baseLocalX : Number
Mouse location in x axis within the target object coordinate space after offsets are applied when the control is first clicked.
ControlInteractive
  baseLocalY : Number
Mouse location in y axis within the target object coordinate space when the control is first clicked.
ControlInteractive
  baseRegistration : Point
Registration point location within the Transform Tool coordinate space when the control is first clicked.
ControlInteractive
  baseX : Number
Mouse location in x axis within the Transform Tool coordinate space when the control is first clicked.
ControlInteractive
  baseY : Number
Mouse location in y axis within the Transform Tool coordinate space when the control is first clicked.
ControlInteractive
  localMouse : Point
Mouse location within the target object coordinate space when the control is first clicked.
ControlInteractive
  mouse : Point
Mouse location within the Transform Tool coordinate space when the control is first clicked.
ControlInteractive
  offsetMouse : Point
Offset for the mouse position.
ControlInteractive
Public Methods
 MethodDefined By
  
ControlInteractive(cursor:Cursor = null)
Constructor for creating new ControlInteractive instances.
ControlInteractive
 Inherited
draw():void
Draws the visuals of the control.
Control
  
redraw(event:Event):void
[override] Handler for the TransformTool.REDRAW event.
ControlInteractive
Protected Methods
 MethodDefined By
  
activeMouseMove(event:MouseEvent):void
Handler for the MouseEvent.MOUSE_MOVE event from the activeTarget object.
ControlInteractive
  
activeMouseUp(event:MouseEvent):void
Handler for the MouseEvent.MOUSE_UP event (capture and no capture) from the activeTarget object.
ControlInteractive
 Inherited
added(event:Event):void
Handler for the Event.ADDED event (capture).
Control
 Inherited
addedToStage(event:Event):void
Handler for the Event.ADDED_TO_STAGE event.
Control
  
calculateAndUpdate(commit:Boolean = true, enforceNegativeScaling:Boolean = true):void
Calls calculateTransform and update from the parent TransformTool instance.
ControlInteractive
  
Clears variables and listeners for tracking the mouse location.
ControlInteractive
  
Cleanup steps when defining a new cursor value.
ControlInteractive
 Inherited
Cleanup steps when defining a new tool value.
Control
  
mouseDown(event:MouseEvent):void
Handler for the MouseEvent.ROLL_OUT event for the control object.
ControlInteractive
  
mouseUp(event:MouseEvent):void
Handler for the MouseEvent.MOUSE_UP event for the control object.
ControlInteractive
  
move():void
Moves the transform using the current mouse position (applied to postTransform).
ControlInteractive
  
Moves the registration point using the current mouse position.
ControlInteractive
  
removedFromStage(event:Event):void
[override] Handler for the Event.REMOVED_FROM_STAGE event.
ControlInteractive
  
restrict(event:Event):void
Handler for the TransformTool.RESTRICT event.
ControlInteractive
  
rollOut(event:MouseEvent):void
Handler for the MouseEvent.ROLL_OUT event for the control object.
ControlInteractive
  
rollOver(event:MouseEvent):void
Handler for the MouseEvent.ROLL_OVER event for the control object.
ControlInteractive
  
rotate():void
Rotates a transform using the current mouse position (applied to postTransform).
ControlInteractive
  
scale():void
Scales the transform along both the x and y axes using the current mouse position (applied to preTransform).
ControlInteractive
  
scaleXAxis():void
Scales the transform along the axis using the current mouse position (applied to preTransform).
ControlInteractive
  
scaleYAxis():void
Scales the transform along the y axis using the current mouse position (applied to preTransform).
ControlInteractive
  
Intializes variables and listeners for tracking the mouse location.
ControlInteractive
  
Setup steps when defining a new cursor value.
ControlInteractive
  
setupTool():void
[override] Setup steps when defining a new tool value.
ControlInteractive
  
skewXAxis():void
Skews the transform along the x axis using the current mouse position (applied to preTransform).
ControlInteractive
  
skewYAxis():void
Skews the transform along the y axis using the current mouse position (applied to preTransform).
ControlInteractive
  
targetChanged(event:Event):void
[override] Handler for the TransformTool.TARGET_CHANGED event.
ControlInteractive
  
Scales the transform along both the x and y axes using the current mouse position in a uniform fashion (applied to preTransform).
ControlInteractive
  
Updates active references for mouse positions.
ControlInteractive
  
Updates base references for mouse positions.
ControlInteractive
  
Updates the values of the base references.
ControlInteractive
  
updateMousePositions(event:MouseEvent = null):void
Updates mouse position references from the provided mouse event.
ControlInteractive
Public Constants
 ConstantDefined By
  MIN_SCALE_BASE : Number = .1
The minimum distance to allow scaling.
ControlInteractive
Property Detail
activeLocalXproperty
protected var activeLocalX:Number

Mouse location in x axis within the target object coordinate space while the control is being dragged.

activeLocalYproperty 
protected var activeLocalY:Number

Mouse location in y axis within the target object coordinate space while the control is being dragged.

activeMouseEventproperty 
protected var activeMouseEvent:MouseEvent

The most recent mouse event received by the activeTarget dispatcher when consuming mouse events.

activeTargetproperty 
protected var activeTarget:IEventDispatcher

The object from which mouse events are consumed. This would normally be the stage instance, but root may be used if stage is not allowed.

activeXproperty 
protected var activeX:Number

Mouse location in x axis within the Transform Tool coordinate space while the control is being dragged.

activeYproperty 
protected var activeY:Number

Mouse location in y axis within the Transform Tool coordinate space while the control is being dragged.

baseLocalMatrixInvertedproperty 
protected var baseLocalMatrixInverted:Matrix

Inverted base matrix used to convert locations in the Transform Tool coordinate space into locations within the target object coordinate space.

baseLocalRegistrationproperty 
protected var baseLocalRegistration:Point

Registration point location within the target object coordinate space when the control is first clicked. Used to derive base values.

baseLocalXproperty 
protected var baseLocalX:Number

Mouse location in x axis within the target object coordinate space after offsets are applied when the control is first clicked.

baseLocalYproperty 
protected var baseLocalY:Number

Mouse location in y axis within the target object coordinate space when the control is first clicked.

baseRegistrationproperty 
protected var baseRegistration:Point

Registration point location within the Transform Tool coordinate space when the control is first clicked. Used to derive base values.

baseXproperty 
protected var baseX:Number

Mouse location in x axis within the Transform Tool coordinate space when the control is first clicked.

baseYproperty 
protected var baseY:Number

Mouse location in y axis within the Transform Tool coordinate space when the control is first clicked.

cursorproperty 
cursor:Cursor

The cursor to be used when interacting with this control.


Implementation
    public function get cursor():Cursor
    public function set cursor(value:Cursor):void
localMouseproperty 
protected var localMouse:Point

Mouse location within the target object coordinate space when the control is first clicked.

mouseproperty 
protected var mouse:Point

Mouse location within the Transform Tool coordinate space when the control is first clicked.

offsetMouseproperty 
protected var offsetMouse:Point

Offset for the mouse position.

Constructor Detail
ControlInteractive()Constructor
public function ControlInteractive(cursor:Cursor = null)

Constructor for creating new ControlInteractive instances.

Parameters
cursor:Cursor (default = null) — The cursor to be used while interacting with the control instance.
Method Detail
activeMouseMove()method
protected function activeMouseMove(event:MouseEvent):void

Handler for the MouseEvent.MOUSE_MOVE event from the activeTarget object. This is used to update the active mouse positions.

Parameters

event:MouseEvent

activeMouseUp()method 
protected function activeMouseUp(event:MouseEvent):void

Handler for the MouseEvent.MOUSE_UP event (capture and no capture) from the activeTarget object. This is used to cleanup mouse handlers and commit the target object. This handler handles both capture and bubble/at-target phases but does not perform its operations in phases other than capture and at-target.

Parameters

event:MouseEvent

calculateAndUpdate()method 
protected function calculateAndUpdate(commit:Boolean = true, enforceNegativeScaling:Boolean = true):void

Calls calculateTransform and update from the parent TransformTool instance.

Parameters

commit:Boolean (default = true) — The value of commit to be used in TransformTool.update().
 
enforceNegativeScaling:Boolean (default = true) — The value of enforceNegativeScaling to be used in tool.calculateTransform().

cleanupActiveMouse()method 
protected function cleanupActiveMouse():void

Clears variables and listeners for tracking the mouse location.

cleanupCursor()method 
protected function cleanupCursor():void

Cleanup steps when defining a new cursor value. You may need to override this method to control the order of operations when adding content to the set cursor setter. This is called before a new cursor value is set.

mouseDown()method 
protected function mouseDown(event:MouseEvent):void

Handler for the MouseEvent.ROLL_OUT event for the control object. This is used to determine if the cursor needs to be changed.

Parameters

event:MouseEvent

mouseUp()method 
protected function mouseUp(event:MouseEvent):void

Handler for the MouseEvent.MOUSE_UP event for the control object. This is used to set the cursor

Parameters

event:MouseEvent

move()method 
protected function move():void

Moves the transform using the current mouse position (applied to postTransform).

moveRegistration()method 
protected function moveRegistration():void

Moves the registration point using the current mouse position.

redraw()method 
override public function redraw(event:Event):void

Handler for the TransformTool.REDRAW event. This has no default behavior and is to be overriden by subclasses if needed.

Parameters

event:Event

removedFromStage()method 
override protected function removedFromStage(event:Event):void

Handler for the Event.REMOVED_FROM_STAGE event. By default, this is used to clear the tool reference.

Parameters

event:Event

restrict()method 
protected function restrict(event:Event):void

Handler for the TransformTool.RESTRICT event. This has no default behavior and is to be overriden by subclasses if needed.

Parameters

event:Event

rollOut()method 
protected function rollOut(event:MouseEvent):void

Handler for the MouseEvent.ROLL_OUT event for the control object. This is used to determine if the cursor needs to be changed.

Parameters

event:MouseEvent

rollOver()method 
protected function rollOver(event:MouseEvent):void

Handler for the MouseEvent.ROLL_OVER event for the control object. This is used to determine if the cursor needs to be changed.

Parameters

event:MouseEvent

rotate()method 
protected function rotate():void

Rotates a transform using the current mouse position (applied to postTransform).

scale()method 
protected function scale():void

Scales the transform along both the x and y axes using the current mouse position (applied to preTransform).

scaleXAxis()method 
protected function scaleXAxis():void

Scales the transform along the axis using the current mouse position (applied to preTransform).

scaleYAxis()method 
protected function scaleYAxis():void

Scales the transform along the y axis using the current mouse position (applied to preTransform).

setupActiveMouse()method 
protected function setupActiveMouse():void

Intializes variables and listeners for tracking the mouse location.

setupCursor()method 
protected function setupCursor():void

Setup steps when defining a new cursor value. You may need to override this method to control the order of operations when adding content to the set cursor setter. This is called after a new cursor value is set.

setupTool()method 
override protected function setupTool():void

Setup steps when defining a new tool value. You may need to override this method to control the order of operations when adding content to the set tool setter. This is called after a new tool value is set.

skewXAxis()method 
protected function skewXAxis():void

Skews the transform along the x axis using the current mouse position (applied to preTransform).

skewYAxis()method 
protected function skewYAxis():void

Skews the transform along the y axis using the current mouse position (applied to preTransform).

targetChanged()method 
override protected function targetChanged(event:Event):void

Handler for the TransformTool.TARGET_CHANGED event. This has no default behavior and is to be overriden by subclasses if needed.

Parameters

event:Event

uniformScale()method 
protected function uniformScale():void

Scales the transform along both the x and y axes using the current mouse position in a uniform fashion (applied to preTransform).

updateActiveMouse()method 
protected function updateActiveMouse():void

Updates active references for mouse positions. These references are used to represent the most up to date state of the mouse position as a control is being interacted with.

updateBaseMouse()method 
protected function updateBaseMouse():void

Updates base references for mouse positions. These references are used to represent the base state of mouse position when the control was first interacted with.

updateBaseReferences()method 
protected function updateBaseReferences():void

Updates the values of the base references.

updateMousePositions()method 
protected function updateMousePositions(event:MouseEvent = null):void

Updates mouse position references from the provided mouse event.

Parameters

event:MouseEvent (default = null) — MouseEvent from which to obtain mouse positions.

Constant Detail
MIN_SCALE_BASEConstant
public const MIN_SCALE_BASE:Number = .1

The minimum distance to allow scaling. if the distance between the mouse position and the registration pont is less than this value, scaling is not permitted.