ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
fl.motion 

DynamicMatrix  - AS3 Flash

Packagefl.motion
Classpublic class DynamicMatrix
InheritanceDynamicMatrix Inheritance Object
Subclasses ColorMatrix

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9, AIR 1.0

The DynamicMatrix class calculates and stores a matrix based on given values. This class supports the ColorMatrixFilter and can be extended by the ColorMatrix class.

Related API Elements



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
Public Methods
 MethodDefined By
  
DynamicMatrix(width:int, height:int)
Constructs a matrix with the given number of rows and columns.
DynamicMatrix
  
Adds the current matrix with a specified matrix.
DynamicMatrix
  
Returns the number of rows in the current matrix.
DynamicMatrix
  
Returns the value at the specified zero-based row and column in the current matrix.
DynamicMatrix
  
Returns the number of columns in the current matrix.
DynamicMatrix
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
  
Sets the current matrix to an identity matrix.
DynamicMatrix
  
Sets all values in the current matrix to zero.
DynamicMatrix
  
Multiplies the current matrix with a specified matrix; and either appends or prepends the specified matrix.
DynamicMatrix
  
Multiplies a number with each item in the matrix and stores the results in the current matrix.
DynamicMatrix
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
SetValue(row:int, col:int, value:Number):void
Sets the value at a specified zero-based row and column in the current matrix.
DynamicMatrix
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Public Constants
 ConstantDefined By
  MATRIX_ORDER_APPEND : int = 1
[static] Specifies that a matrix is appended for concatenation.
DynamicMatrix
  MATRIX_ORDER_PREPEND : int = 0
[static] Specifies that a matrix is prepended for concatenation.
DynamicMatrix
Constructor Detail

DynamicMatrix

()Constructor
public function DynamicMatrix(width:int, height:int)

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9, AIR 1.0

Constructs a matrix with the given number of rows and columns.

Parameters
width:int — Number of columns.
 
height:int — Number of rows.
Method Detail

Add

()method
public function Add(inMatrix:DynamicMatrix):Boolean

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9, AIR 1.0

Adds the current matrix with a specified matrix. The current matrix becomes the result of the addition (in other words the DynamicMatrix.Add() method does not create a new matrix to contain the result).

Parameters

inMatrix:DynamicMatrix — The matrix to add to the current matrix.

Returns
Boolean — A Boolean value indicating whether the addition succeeded (true) or failed (false). If the dimensions of the matrices are not the same, DynamicMatrix.Add() returns false.

GetHeight

()method 
public function GetHeight():Number

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9, AIR 1.0

Returns the number of rows in the current matrix.

Returns
Number — The number of rows.

GetValue

()method 
public function GetValue(row:int, col:int):Number

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9, AIR 1.0

Returns the value at the specified zero-based row and column in the current matrix.

Parameters

row:int — The row containing the value you want.
 
col:int — The column containing the value you want.

Returns
Number — Number The value at the specified row and column location.

GetWidth

()method 
public function GetWidth():Number

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9, AIR 1.0

Returns the number of columns in the current matrix.

Returns
Number — The number of columns.

Related API Elements

LoadIdentity

()method 
public function LoadIdentity():void

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9, AIR 1.0

Sets the current matrix to an identity matrix.

Related API Elements

LoadZeros

()method 
public function LoadZeros():void

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9, AIR 1.0

Sets all values in the current matrix to zero.

Multiply

()method 
public function Multiply(inMatrix:DynamicMatrix, order:int):Boolean

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9, AIR 1.0

Multiplies the current matrix with a specified matrix; and either appends or prepends the specified matrix. Use the second parameter of the DynamicMatrix.Multiply() method to append or prepend the specified matrix.

Parameters

inMatrix:DynamicMatrix — The matrix to add to the current matrix.
 
order:int (default = NaN) — Specifies whether to append or prepend the matrix from the inMatrix parameter; either MATRIX_ORDER_APPEND or MATRIX_ORDER_PREPEND.

Returns
Boolean — A Boolean value indicating whether the multiplication succeeded (true) or failed (false). The value is false if either the current matrix or specified matrix (the inMatrix parameter) is null, or if the order is to append and the current matrix's width is not the same as the supplied matrix's height; or if the order is to prepend and the current matrix's height is not equal to the supplied matrix's width.

Related API Elements

MultiplyNumber

()method 
public function MultiplyNumber(value:Number):Boolean

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9, AIR 1.0

Multiplies a number with each item in the matrix and stores the results in the current matrix.

Parameters

value:Number — A number to multiply by each item in the matrix.

Returns
Boolean — A Boolean value indicating whether the multiplication succeeded (true) or failed (false).

SetValue

()method 
public function SetValue(row:int, col:int, value:Number):void

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9, AIR 1.0

Sets the value at a specified zero-based row and column in the current matrix.

Parameters

row:int — The row containing the value you want to set.
 
col:int — The column containing the value you want to set.
 
value:Number — The number to insert into the matrix.
Constant Detail

MATRIX_ORDER_APPEND

Constant
public static const MATRIX_ORDER_APPEND:int = 1

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9, AIR 1.0

Specifies that a matrix is appended for concatenation.

MATRIX_ORDER_PREPEND

Constant 
public static const MATRIX_ORDER_PREPEND:int = 0

Language Version: ActionScript 3.0
Product Version: Flash CS3
Runtime Versions: Flash Player 9, AIR 1.0

Specifies that a matrix is prepended for concatenation.