Packagecom.senocular.display.transform
Classpublic class TransformTool
InheritanceTransformTool Inheritance flash.display.Sprite

A tool used for transforming display objects visually on the screen. TransformTool instances are placed in a display object container along with the objects it will transform.



Public Properties
 PropertyDefined By
  autoRaise : Boolean
When true, the targets will raise to the top of their display lists, though not above the Transform Tool, when assigned as targets of the tool.
TransformTool
  baseMatrix : Matrix
[read-only] The "committed" matrix transformation of a target object.
TransformTool
  bottomLeft : Point
A reference point (metric) indicating the location of the local bottom left corner of the target object in the TransformTool coordinate space.
TransformTool
  bottomRight : Point
A reference point (metric) indicating the location of the local bottom right corner of the target object in the TransformTool coordinate space.
TransformTool
  calculatedMatrix : Matrix
[read-only] The current transformation matrix of the Transform Tool.
TransformTool
  controls : Array
A representation of the TransformTool's display list in array form.
TransformTool
  cursor : DisplayObject
The cursor to be displayed by the Transform Tool.
TransformTool
  cursorEvent : Event
[read-only] The event that invoked a change in the cursor.
TransformTool
  cursorHidesMouse : Boolean
When true, the native mouse cursor will be hidden with Mouse.hide() when the cursor is non-null.
TransformTool
  isActive : Boolean
Indicates that a transform control has assumed control of the tool for interaction.
TransformTool
  livePreview : Boolean
When true, the target is visually transformed with the tool between target commits as the user changes the transform with interactive controls.
TransformTool
  localRegistration : Point
[read-only] The current location of the registration point in the context of the target object's coordinate space.
TransformTool
  maxHeight : Number
The maximum height along the transformed y axis that a target object is allowed to have.
TransformTool
  maxRotation : Number
The maximum rotation allowed for a transformed target object.
TransformTool
  maxScaleX : Number
The maximum scale along the transformed x axis that a target object is allowed to have.
TransformTool
  maxScaleY : Number
The maximum scale along the transformed y axis that a target object is allowed to have.
TransformTool
  maxWidth : Number
The maximum width along the transformed x axis that a target object is allowed to have.
TransformTool
  minHeight : Number
The minimum height along the transformed y axis that a target object is allowed to have.
TransformTool
  minRotation : Number
The minimum rotation allowed for a transformed target object.
TransformTool
  minScaleX : Number
The minimum scale along the transformed x axis that a target object is allowed to have.
TransformTool
  minScaleY : Number
The minimum scale along the transformed y axis that a target object is allowed to have.
TransformTool
  minWidth : Number
The minimum width along the transformed x axis that a target object is allowed to have.
TransformTool
  negativeScaling : Boolean
Determines whether or not transforming is allowed to result in negative scales.
TransformTool
  postTransform : Matrix
[read-only]
TransformTool
  preTransform : Matrix
[read-only]
TransformTool
  registration : Point
A reference point (metric) indicating the location of the registration point within the TransformTool coordinate space.
TransformTool
  registrationManager : RegistrationManager
The registration manager used to keep track of registration points in target objects.
TransformTool
  target : DisplayObject
Target display object to be transformed by the TransformTool.
TransformTool
  targetEvent : Event
[read-only] A saved reference to the event that selected the target when TransformTool.select was used.
TransformTool
  targetEventMouse : Point
[read-only]
TransformTool
  topLeft : Point
A reference point (metric) indicating the location of the local top left corner of the target object in the TransformTool coordinate space.
TransformTool
  topRight : Point
A reference point (metric) indicating the location of the local top right corner of the target object in the TransformTool coordinate space.
TransformTool
  transformMethod : String
Determines the method by which tool transformations are applied to the target display object.
TransformTool
Protected Properties
 PropertyDefined By
  _baseMatrix : Matrix
TransformTool
  _calculatedMatrix : Matrix
TransformTool
  _cursorEvent : Event
TransformTool
  _postTransform : Matrix
TransformTool
  _preTransform : Matrix
TransformTool
  _targetEvent : Event
TransformTool
  _targetEventMouse : Point
TransformTool
Public Methods
 MethodDefined By
  
TransformTool(controls:Array = null, registrationManager:RegistrationManager = null)
Constructor for new TransformTool instances.
TransformTool
  
calculateTransform(reset:Boolean = true, enforceNegativeScaling:Boolean = true):void
Calculates the value of calculatedMatrix by applying the values of preTransform and postTransform to the baseMatrix.
TransformTool
  
Applies the calculatedMatrix transform to the target object and commits the target to the transformation.
TransformTool
  
deselect(event:Event):void
Helper selection handler for deselecting target objects.
TransformTool
  
Fits the Transform Tool to match the current state of the target.
TransformTool
  
getHeight():Number
Returns the height of the target object based on its size within its transformed y axis and the current value of calculatedMatrix.
TransformTool
  
getRotation():Number
Returns the rotation of target object based on the current value of calculatedMatrix.
TransformTool
  
getRotationX(matrix:Matrix = null):Number
Returns the rotation of a matrix on its x axis.
TransformTool
  
getRotationY(matrix:Matrix = null):Number
Returns the rotation of a matrix on its y axis.
TransformTool
  
getScaleX(matrix:Matrix = null):Number
Returns the scale of a matrix along its x axis.
TransformTool
  
getScaleY(matrix:Matrix = null):Number
Returns the scale of a matrix along its y axis.
TransformTool
  
getWidth():Number
Returns the width of the target object based on its size within its transformed x axis and the current value of calculatedMatrix.
TransformTool
  
isPositiveScale(matrix:Matrix = null):Boolean
Determines if a matrix is scaled positively or not.
TransformTool
  
matrixEquals(m1:Matrix, m2:Matrix = null):Boolean
Compares two matrices to see if they're equal.
TransformTool
  
normalizeBase(amount:Number = 1):Boolean
For zero-scale transformations, this function will reset the base scale to represent a positive value represented by the amount value.
TransformTool
  
raise():void
Moves the Transform Tool and the target object to the tops of their respective parent display lists.
TransformTool
  
Resets the registration point to its default location relative to the (0,0) position in the target object's local coordinate space.
TransformTool
  
Resets the transformation of the target object to it's unmodified state.
TransformTool
  
Applies restrictions to rotation.
TransformTool
  
restrictScale(enforceNegativeScaling:Boolean = true):void
Applies restrictions to scaling.
TransformTool
  
Saves the current registration point value in localRegistration to the registration manager.
TransformTool
  
select(event:Event):void
Helper selection handler for selecting target objects.
TransformTool
  
setCursor(value:DisplayObject, cursorEvent:Event = null):void
Sets the cursor for the transform tool with a respective cursor event that identifies the event that caused the change in the cursor.
TransformTool
  
setHeight(value:Number):void
Sets the height of calculatedMatrix based on the size of the current target.
TransformTool
  
setRotation(value:Number, matrix:Matrix = null):void
Sets the rotation of a matrix.
TransformTool
  
setScaleX(value:Number, matrix:Matrix = null):void
Sets the scale of a matrix along its x axis.
TransformTool
  
setScaleY(value:Number, matrix:Matrix = null):void
Sets the scale of a matrix along its y axis.
TransformTool
  
setTarget(value:DisplayObject, targetEvent:Event = null):void
TransformTool
  
setWidth(value:Number):void
Sets the width of calculatedMatrix based on the size of the current target.
TransformTool
  
update(commit:Boolean = true):void
Performs a full update of the Transform Tool.
TransformTool
  
Dispatches an update event (REDRAW) allowing controls within the tool to update themselves to match the current calculatedMatrix transform.
TransformTool
  
Updates references used to identify points of interest in the Transform Tool.
TransformTool
  
Applies the calculatedMatrix transform to the target object.
TransformTool
Protected Methods
 MethodDefined By
  
Adds registration offset to transformation matrix.
TransformTool
  
Applies the transform defined by calculatedMatrix to the target object.
TransformTool
  
Cleanup steps when defining a new cursor value.
TransformTool
  
Cleanup steps when defining a new target value.
TransformTool
  
resetTransformModifiers(resetBase:Boolean = true):void
Resets the values of preTransform, postTransform, and optionally baseMatrix to their defaults.
TransformTool
  
restrict(enforceNegativeScaling:Boolean = true):void
Goes under the assumption that scaling is handled by the preTransform and rotation is handled by the postTransform matrices.
TransformTool
  
Retrieves the current registration point from the registration manager assigning it to localRegistration.
TransformTool
  
Setup steps when defining a new cursor value.
TransformTool
  
TransformTool
  
TransformTool
Public Constants
 ConstantDefined By
  COMMIT : String = commit
[static] Event constant for commit event types.
TransformTool
  CURSOR_CHANGED : String = cursorChanged
[static] Event constant for cursorChanged event types.
TransformTool
  REDRAW : String = redraw
[static] Event constant for redraw event types.
TransformTool
  RESTRICT : String = restrict
[static] Event constant for restrict event types.
TransformTool
  TARGET_CHANGED : String = targetChanged
[static] Event constant for targetChanged event types.
TransformTool
  TARGET_TRANSFORMED : String = targetTransformed
[static] Event constant for targetTransformed event types.
TransformTool
  TRANSFORM_CHANGED : String = transformChanged
[static] Event constant for transformChanged event types.
TransformTool
  TRANSFORM_MATRIX : String = matrix
[static] Transform method for transforming a target object by updating DisplayObject.transform.matrix.
TransformTool
  TRANSFORM_PROPERTIES : String = properties
[static] Transform method for transforming a target object by updating properties such as DisplayObject.width, DisplayObject.height and DisplayObject.rotation.
TransformTool
Property Detail
_baseMatrixproperty
protected var _baseMatrix:Matrix

_calculatedMatrixproperty 
protected var _calculatedMatrix:Matrix

_cursorEventproperty 
protected var _cursorEvent:Event

_postTransformproperty 
protected var _postTransform:Matrix

_preTransformproperty 
protected var _preTransform:Matrix

_targetEventproperty 
protected var _targetEvent:Event

_targetEventMouseproperty 
protected var _targetEventMouse:Point

autoRaiseproperty 
autoRaise:Boolean

When true, the targets will raise to the top of their display lists, though not above the Transform Tool, when assigned as targets of the tool.


Implementation
    public function get autoRaise():Boolean
    public function set autoRaise(value:Boolean):void
baseMatrixproperty 
baseMatrix:Matrix  [read-only]

The "committed" matrix transformation of a target object. This is the matrix on which other transformations are based. This is set when the target is set and when is committed with methods like commitTarget(). When preTransform and postTransform are applied, they're applied to the baseMatrix value to resolve the calculatedMatrix.


Implementation
    public function get baseMatrix():Matrix
bottomLeftproperty 
public var bottomLeft:Point

A reference point (metric) indicating the location of the local bottom left corner of the target object in the TransformTool coordinate space.

bottomRightproperty 
public var bottomRight:Point

A reference point (metric) indicating the location of the local bottom right corner of the target object in the TransformTool coordinate space.

calculatedMatrixproperty 
calculatedMatrix:Matrix  [read-only]

The current transformation matrix of the Transform Tool. This is updated when the target is defined and when calculateTransform is called. Controls will automatically call calculateTransform when used, updating the calculatedMatrix during transformations.


Implementation
    public function get calculatedMatrix():Matrix
controlsproperty 
controls:Array

A representation of the TransformTool's display list in array form. Control sets are assigned to this property.


Implementation
    public function get controls():Array
    public function set controls(value:Array):void
cursorproperty 
cursor:DisplayObject

The cursor to be displayed by the Transform Tool. Cursors are generally defined in and set by controls. Using the ControlCursor control, the cursor can be seen in the TransformTool instance itself. Otherwise, cursors will have to be manually displayed by listening for the CURSOR_CHANGED event.


Implementation
    public function get cursor():DisplayObject
    public function set cursor(value:DisplayObject):void
cursorEventproperty 
cursorEvent:Event  [read-only]

The event that invoked a change in the cursor.


Implementation
    public function get cursorEvent():Event
cursorHidesMouseproperty 
cursorHidesMouse:Boolean

When true, the native mouse cursor will be hidden with Mouse.hide() when the cursor is non-null.


Implementation
    public function get cursorHidesMouse():Boolean
    public function set cursorHidesMouse(value:Boolean):void
isActiveproperty 
isActive:Boolean

Indicates that a transform control has assumed control of the tool for interaction. Other controls would check this value to see if it is able to interact with the tool without interference from other controls.


Implementation
    public function get isActive():Boolean
    public function set isActive(value:Boolean):void
livePreviewproperty 
livePreview:Boolean

When true, the target is visually transformed with the tool between target commits as the user changes the transform with interactive controls. If false, target objects are only updated when the target is committed which (typically) occurs only after interaction with a control has completed.


Implementation
    public function get livePreview():Boolean
    public function set livePreview(value:Boolean):void
localRegistrationproperty 
localRegistration:Point  [read-only]

The current location of the registration point in the context of the target object's coordinate space. This value will always be a Point instance. When there is no target, the value will be (0, 0). The registration manager uses this value to store registration points for objects.


Implementation
    public function get localRegistration():Point
maxHeightproperty 
maxHeight:Number

The maximum height along the transformed y axis that a target object is allowed to have. If both a maxHeight and maxScaleY are specified, the value resulting in the smallest value will be used.


Implementation
    public function get maxHeight():Number
    public function set maxHeight(value:Number):void
maxRotationproperty 
maxRotation:Number

The maximum rotation allowed for a transformed target object. Ranges between minRotation and maxRotation depend on which value of the two is greater.


Implementation
    public function get maxRotation():Number
    public function set maxRotation(value:Number):void
maxScaleXproperty 
maxScaleX:Number

The maximum scale along the transformed x axis that a target object is allowed to have. If both a maxWidth and maxScaleX are specified, the value resulting in the smallest value will be used.


Implementation
    public function get maxScaleX():Number
    public function set maxScaleX(value:Number):void
maxScaleYproperty 
maxScaleY:Number

The maximum scale along the transformed y axis that a target object is allowed to have. If both a maxHeight and maxScaleY are specified, the value resulting in the smallest value will be used.


Implementation
    public function get maxScaleY():Number
    public function set maxScaleY(value:Number):void
maxWidthproperty 
maxWidth:Number

The maximum width along the transformed x axis that a target object is allowed to have. If both a maxWidth and maxScaleX are specified, the value resulting in the smallest value will be used.


Implementation
    public function get maxWidth():Number
    public function set maxWidth(value:Number):void
minHeightproperty 
minHeight:Number

The minimum height along the transformed y axis that a target object is allowed to have. If both a minHeight and minScaleY are specified, the value resulting in the highest value will be used.


Implementation
    public function get minHeight():Number
    public function set minHeight(value:Number):void
minRotationproperty 
minRotation:Number

The minimum rotation allowed for a transformed target object. Ranges between minRotation and maxRotation depend on which value of the two is greater.


Implementation
    public function get minRotation():Number
    public function set minRotation(value:Number):void
minScaleXproperty 
minScaleX:Number

The minimum scale along the transformed x axis that a target object is allowed to have. If both a minWidth and minScaleX are specified, the value resulting in the highest value will be used.


Implementation
    public function get minScaleX():Number
    public function set minScaleX(value:Number):void
minScaleYproperty 
minScaleY:Number

The minimum scale along the transformed y axis that a target object is allowed to have. If both a minHeight and minScaleY are specified, the value resulting in the highest value will be used.


Implementation
    public function get minScaleY():Number
    public function set minScaleY(value:Number):void
minWidthproperty 
minWidth:Number

The minimum width along the transformed x axis that a target object is allowed to have. If both a minWidth and minScaleX are specified, the value resulting in the highest value will be used.


Implementation
    public function get minWidth():Number
    public function set minWidth(value:Number):void
negativeScalingproperty 
negativeScaling:Boolean

Determines whether or not transforming is allowed to result in negative scales. When true, negative scaling is allowed and a transformed target object can be mirrored along its x and/or y axes. When false, negative scaling is not allowed and scale for both axes will always be positive.


Implementation
    public function get negativeScaling():Boolean
    public function set negativeScaling(value:Boolean):void
postTransformproperty 
postTransform:Matrix  [read-only]


Implementation
    public function get postTransform():Matrix
preTransformproperty 
preTransform:Matrix  [read-only]


Implementation
    public function get preTransform():Matrix
registrationproperty 
public var registration:Point

A reference point (metric) indicating the location of the registration point within the TransformTool coordinate space.

registrationManagerproperty 
registrationManager:RegistrationManager

The registration manager used to keep track of registration points in target objects. When using multiple instances of TransformTool, you may want to have each instance use the same registration manager so that each Transform Tool uses the same registration points for objects.


Implementation
    public function get registrationManager():RegistrationManager
    public function set registrationManager(value:RegistrationManager):void

Throws
ArgumentError — The specified value is null.
targetproperty 
target:DisplayObject

Target display object to be transformed by the TransformTool.


Implementation
    public function get target():DisplayObject
    public function set target(value:DisplayObject):void
targetEventproperty 
targetEvent:Event  [read-only]

A saved reference to the event that selected the target when TransformTool.select was used. This allows controls to use that event to perform appropriate actions during selection, such as starting a drag (move) operation on the target.


Implementation
    public function get targetEvent():Event
targetEventMouseproperty 
targetEventMouse:Point  [read-only]


Implementation
    public function get targetEventMouse():Point
topLeftproperty 
public var topLeft:Point

A reference point (metric) indicating the location of the local top left corner of the target object in the TransformTool coordinate space.

topRightproperty 
public var topRight:Point

A reference point (metric) indicating the location of the local top right corner of the target object in the TransformTool coordinate space.

transformMethodproperty 
transformMethod:String

Determines the method by which tool transformations are applied to the target display object.


Implementation
    public function get transformMethod():String
    public function set transformMethod(value:String):void
Constructor Detail
TransformTool()Constructor
public function TransformTool(controls:Array = null, registrationManager:RegistrationManager = null)

Constructor for new TransformTool instances.

Parameters
controls:Array (default = null) — An array of controls to be added to the display list.
 
registrationManager:RegistrationManager (default = null) — The registration manager to use for target objects assigned to this TransformTool instance. If one is not specified, one is created automatically.
Method Detail
applyRegistrationOffset()method
protected function applyRegistrationOffset():void

Adds registration offset to transformation matrix. This assumes deriveFinalTransform has already been called.

applyTransformToTarget()method 
protected function applyTransformToTarget():Boolean

Applies the transform defined by calculatedMatrix to the target object. How this is applied depends on the value of transformMethod.

Returns
Boolean — True if the target object was changed, false if not.
calculateTransform()method 
public function calculateTransform(reset:Boolean = true, enforceNegativeScaling:Boolean = true):void

Calculates the value of calculatedMatrix by applying the values of preTransform and postTransform to the baseMatrix. The value of calculatedMatrix is used when transforms are being applied to the tool and its target object.

Parameters

reset:Boolean (default = true) — When true, the preTransform and postTransform modifiers will be reset to their identity matrix after the calculation is complete.
 
enforceNegativeScaling:Boolean (default = true) — When false, scale restrictions that use negativeScaling to restrict calculatedMatrix are ignored.

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.

cleanupTarget()method 
protected function cleanupTarget():void

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

commitTarget()method 
public function commitTarget():void

Applies the calculatedMatrix transform to the target object and commits the target to the transformation. This will reset all transformation modifiers (preTransform and postTransform) and set the baseMatrix to the updated transform of the target.

deselect()method 
public function deselect(event:Event):void

Helper selection handler for deselecting target objects. Set this handler as the listener for an event that would cause the deselection of a target object.

Parameters

event:Event

fitToTarget()method 
public function fitToTarget():void

Fits the Transform Tool to match the current state of the target. Use this when the target object is transformed outside of the Transform Tool.

getHeight()method 
public function getHeight():Number

Returns the height of the target object based on its size within its transformed y axis and the current value of calculatedMatrix. This is different from the normal height reported by DisplayObject which is based on the height of the object within its parent's coordinate space. If no target exists 0 is returned.

Returns
Number — The height of the target object.
getRotation()method 
public function getRotation():Number

Returns the rotation of target object based on the current value of calculatedMatrix. A matrix's general rotation is based on the rotation of its x axis.

Returns
Number — The rotation of a matrix in radians.
getRotationX()method 
public function getRotationX(matrix:Matrix = null):Number

Returns the rotation of a matrix on its x axis.

Parameters

matrix:Matrix (default = null) — The matrix from which to find a rotation. If not specified, calculatedMatrix is used.

Returns
Number — The rotation of a matrix along it's x axis in radians.
getRotationY()method 
public function getRotationY(matrix:Matrix = null):Number

Returns the rotation of a matrix on its y axis.

Parameters

matrix:Matrix (default = null) — The matrix from which to find a rotation. If not specified, calculatedMatrix is used.

Returns
Number — The rotation of a matrix along it's y axis in radians.
getScaleX()method 
public function getScaleX(matrix:Matrix = null):Number

Returns the scale of a matrix along its x axis.

Parameters

matrix:Matrix (default = null) — The matrix from which to get the scale. If not specified, calculatedMatrix is used.

Returns
Number — The scale of a matrix along its x axis.
getScaleY()method 
public function getScaleY(matrix:Matrix = null):Number

Returns the scale of a matrix along its y axis.

Parameters

matrix:Matrix (default = null) — The matrix from which to get the scale. If not specified, calculatedMatrix is used.

Returns
Number — The scale of a matrix along its y axis.
getWidth()method 
public function getWidth():Number

Returns the width of the target object based on its size within its transformed x axis and the current value of calculatedMatrix. This is different from the normal width reported by DisplayObject which is based on the width of the object within its parent's coordinate space. If no target exists 0 is returned.

Returns
Number — The height of the target object.
isPositiveScale()method 
public function isPositiveScale(matrix:Matrix = null):Boolean

Determines if a matrix is scaled positively or not.

Parameters

matrix:Matrix (default = null) — The matrix to determine if it is positively scaled. If not specified, calculatedMatrix is used.

Returns
Boolean — Returns true if the matrix is positively scaled, false if not.
matrixEquals()method 
public function matrixEquals(m1:Matrix, m2:Matrix = null):Boolean

Compares two matrices to see if they're equal.

Parameters

m1:Matrix — A matrix to be compared with another matrix.
 
m2:Matrix (default = null) — The matrix to be compared with the first matrix. If this value is not provided calculatedMatrix is used.

Returns
Boolean — True if the matrices match, false if not.
normalizeBase()method 
public function normalizeBase(amount:Number = 1):Boolean

For zero-scale transformations, this function will reset the base scale to represent a positive value represented by the amount value. This would be needed if transformations expect a non-zero scale, for example if scaling the existing scale which, if zero, would not scale at all.

Parameters

amount:Number (default = 1) — The amount by which the base transformation is normalized in scale. This amount is a pixel value based on the internal bounds of the target object.

Returns
Boolean — True if the base transform was normalized at all, false if no changes were made.
raise()method 
public function raise():void

Moves the Transform Tool and the target object to the tops of their respective parent display lists. This is automatically called when a target is set and autoRaise is true.

resetRegistration()method 
public function resetRegistration():void

Resets the registration point to its default location relative to the (0,0) position in the target object's local coordinate space.

resetTransform()method 
public function resetTransform():void

Resets the transformation of the target object to it's unmodified state.

resetTransformModifiers()method 
protected function resetTransformModifiers(resetBase:Boolean = true):void

Resets the values of preTransform, postTransform, and optionally baseMatrix to their defaults. The pre and post transforms are set to their identity matrices. The baseMatrix is set to the transform matrix of the target object.

Parameters

resetBase:Boolean (default = true) — When true, baseMatrix is reset along with preTransform and postTransform.

restrict()method 
protected function restrict(enforceNegativeScaling:Boolean = true):void

Goes under the assumption that scaling is handled by the preTransform and rotation is handled by the postTransform matrices.

Parameters

enforceNegativeScaling:Boolean (default = true)

restrictRotation()method 
public function restrictRotation():void

Applies restrictions to rotation.

restrictScale()method 
public function restrictScale(enforceNegativeScaling:Boolean = true):void

Applies restrictions to scaling.

Parameters

enforceNegativeScaling:Boolean (default = true) — When false, the value of negativeScaling is not enforced when restricting scale. This should be set to false when rotating a the Transform Tool since rotation can result in what could be considered a negative scale.

retrieveRegistration()method 
protected function retrieveRegistration():void

Retrieves the current registration point from the registration manager assigning it to localRegistration.

saveRegistration()method 
public function saveRegistration():void

Saves the current registration point value in localRegistration to the registration manager.

select()method 
public function select(event:Event):void

Helper selection handler for selecting target objects. Set this handler as the listener for a MouseEvent.MOUSE_DOWN event of an object or a container of objects to have targets automatically set to the Transform Tool when clicked. This event handler uses either Event.target or Event.currentTarget as TransformTool.target depending on which is in the same display object container as the Transform Tool itself.

Parameters

event:Event

setCursor()method 
public function setCursor(value:DisplayObject, cursorEvent:Event = null):void

Sets the cursor for the transform tool with a respective cursor event that identifies the event that caused the change in the cursor.

Parameters

value:DisplayObject — The cursor display object to be used for the current Transform Tool cursor.
 
cursorEvent:Event (default = null) — The event that invoked the change in the cursor.

setHeight()method 
public function setHeight(value:Number):void

Sets the height of calculatedMatrix based on the size of the current target. If target is null or the value passed is not a number, calculatedMatrix is unchanged.

Parameters

value:Number — The height value for the target object.

setRotation()method 
public function setRotation(value:Number, matrix:Matrix = null):void

Sets the rotation of a matrix. The rotation set is based on the x axis.

Parameters

value:Number — A new rotation value in radians.
 
matrix:Matrix (default = null) — The matrix on which to set a rotation. If not specified, calculatedMatrix is used.

setScaleX()method 
public function setScaleX(value:Number, matrix:Matrix = null):void

Sets the scale of a matrix along its x axis.

Parameters

value:Number — The matrix for which to set a scale. If not specified, calculatedMatrix is used.
 
matrix:Matrix (default = null)

setScaleY()method 
public function setScaleY(value:Number, matrix:Matrix = null):void

Sets the scale of a matrix along its y axis.

Parameters

value:Number — The matrix for which to set a scale. If not specified, calculatedMatrix is used.
 
matrix:Matrix (default = null)

setTarget()method 
public function setTarget(value:DisplayObject, targetEvent:Event = null):void

Parameters

value:DisplayObject
 
targetEvent:Event (default = null)

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.

setupTarget()method 
protected function setupTarget():void

setWidth()method 
public function setWidth(value:Number):void

Sets the width of calculatedMatrix based on the size of the current target. If target is null or the value passed is not a number, calculatedMatrix is unchanged.

Parameters

value:Number — The height value for the target object.

update()method 
public function update(commit:Boolean = true):void

Performs a full update of the Transform Tool. This includes: updating the metrics, updating the target (with optional commit) and updating the controls.

Parameters

commit:Boolean (default = true) — When true, the target is updated with a call to commitTarget. When false, updateTarget is used.

updateControls()method 
public function updateControls():void

Dispatches an update event (REDRAW) allowing controls within the tool to update themselves to match the current calculatedMatrix transform.

updateMetrics()method 
public function updateMetrics():void

Updates references used to identify points of interest in the Transform Tool. These include points like the registration point, topLeft, bottomRight, etc. Metrics should be updated when the calculatedMatrix is updated and controls need to be redrawn as many controls use these properties to position themselves.

updateTarget()method 
public function updateTarget():void

Applies the calculatedMatrix transform to the target object. Updates are only applied here if livePreview is true. For non-livePreview updates, commitTarget is required.

validateTargetMatrix()method 
protected function validateTargetMatrix():Boolean

Returns
Boolean
Constant Detail
COMMITConstant
public static const COMMIT:String = commit

Event constant for commit event types.

CURSOR_CHANGEDConstant 
public static const CURSOR_CHANGED:String = cursorChanged

Event constant for cursorChanged event types.

REDRAWConstant 
public static const REDRAW:String = redraw

Event constant for redraw event types.

RESTRICTConstant 
public static const RESTRICT:String = restrict

Event constant for restrict event types.

TARGET_CHANGEDConstant 
public static const TARGET_CHANGED:String = targetChanged

Event constant for targetChanged event types.

TARGET_TRANSFORMEDConstant 
public static const TARGET_TRANSFORMED:String = targetTransformed

Event constant for targetTransformed event types.

TRANSFORM_CHANGEDConstant 
public static const TRANSFORM_CHANGED:String = transformChanged

Event constant for transformChanged event types.

TRANSFORM_MATRIXConstant 
public static const TRANSFORM_MATRIX:String = matrix

Transform method for transforming a target object by updating DisplayObject.transform.matrix.

TRANSFORM_PROPERTIESConstant 
public static const TRANSFORM_PROPERTIES:String = properties

Transform method for transforming a target object by updating properties such as DisplayObject.width, DisplayObject.height and DisplayObject.rotation.