EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Offset (Rectangle.offset Method); Offsetpoint (Rectangle.offsetpoint Method)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
1046 ActionScript classes
rect.left = 10;
trace(rect.left); // 10
trace(rect.x); // 10
See also
x (Rectangle.x property), y (Rectangle.y property), width (Rectangle.width
property)
, height (Rectangle.height property)
offset (Rectangle.offset method)
public offset(dx:Number, dy:Number) : Void
Adjusts the location of the Rectangle object, as determined by its top-left corner, by the
specified amounts.
Availability: ActionScript 1.0; Flash Player 8
Parameters
dx:Number - Moves the x value of the Rectangle object by this amount.
dy:Number - Moves the y value of the Rectangle object by this amount.
Example
The following example creates a Rectangle object and offsets its x and y values by 5 and 10
respectively
import flash.geom.Rectangle;
var rect:Rectangle = new Rectangle(1, 2, 4, 8);
trace(rect.toString()); // (x=1, y=2, w=4, h=8)
rect.offset(16, 32);
trace(rect.toString()); // (x=17, y=34, w=4, h=8)
offsetPoint (Rectangle.offsetPoint method)
public offsetPoint(pt:Point) : Void
Adjusts the location of the Rectangle object using a Point object as a parameter. This method
is similar to the
Rectangle.offset() method, except that it takes a Point object as a
parameter.
Availability: ActionScript 1.0; Flash Player 8
Parameters
pt:flash.geom.Point - A Point object to use to offset this Rectangle object.

Table of Contents

Related product manuals