Packagecom.bourre.structures
Classpublic class Dimension

Player version: Flash Player 9.0
Language version: ActionScript 3.0

The Dimension class encapsulates the width and height of an object (in double precision) in a single object.

Normally the values of width and height are non-negative integers. The constructors that allow you to create a dimension do not prevent you from setting a negative value for these properties. If the value of width or height is negative, the behavior of some methods defined by other objects is undefined.



Public Properties
 PropertyDefined by
  height : Number
The height dimension, negative values can be used.
Dimension
  width : Number
The width dimension, negative values can be used.
Dimension
Public Methods
 MethodDefined by
  
Dimension(width:Number = 0, height:Number = 0)
Constructs a Dimension and initializes it to the specified width and specified height.
Dimension
  
Returns a copy of this Dimension object.
Dimension
  
equals(dimension:Dimension):Boolean
Checks whether two dimension objects have equal values.
Dimension
  
scale(n:Number):Dimension
Dimension
  
setSize(dimension:Dimension):void
Sets the size of this Dimension object to the specified size.
Dimension
  
setSizeWH(width:Number, height:Number):void
Sets the size of this Dimension object to the specified width and height.
Dimension
  
toPoint():Point
Returns a Point object with its x and y sets respectively on width and height of this Dimension.
Dimension
  
toString():String
Returns the String representation of this object/
Dimension
Property detail
heightproperty
public var height:Number

Player version: Flash Player 9.0
Language version: ActionScript 3.0

The height dimension, negative values can be used.

widthproperty 
public var width:Number

Player version: Flash Player 9.0
Language version: ActionScript 3.0

The width dimension, negative values can be used.

Constructor detail
Dimension()constructor
public function Dimension(width:Number = 0, height:Number = 0)

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Constructs a Dimension and initializes it to the specified width and specified height.

Parameters
width:Number (default = 0) — specified width
 
height:Number (default = 0) — specified height
Method detail
clone()method
public function clone():Dimension

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns a copy of this Dimension object.

Returns
Dimension — a copy of this Dimension object
equals()method 
public function equals(dimension:Dimension):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Checks whether two dimension objects have equal values.

Parameters
dimension:Dimension — the reference object with which to compare.

Returns
Booleantrue if this object is the same as the obj argument, false otherwise.
scale()method 
public function scale(n:Number):Dimension

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Parameters
n:Number

Returns
Dimension
setSize()method 
public function setSize(dimension:Dimension):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Sets the size of this Dimension object to the specified size.

Parameters
dimension:Dimension — the new size for this Dimension object
setSizeWH()method 
public function setSizeWH(width:Number, height:Number):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Sets the size of this Dimension object to the specified width and height.

Parameters
width:Number — the new width for this Dimension object
 
height:Number — the new height for this Dimension object
toPoint()method 
public function toPoint():Point

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns a Point object with its x and y sets respectively on width and height of this Dimension.

Returns
Point — a Point object which contains values of this Dimension
toString()method 
public function toString():String

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the String representation of this object/

Returns
String — the String representation of this object