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

Actionscript 2.0 language reference
Table of Contents

Advertisement

rect.left = 10;
trace(rect.left); // 10
trace(rect.x); // 10
See also
x (Rectangle.x property)
,
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
- Moves the x value of the Rectangle object by this amount.
dx:Number
- Moves the y value of the Rectangle object by this amount.
dy:Number
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()
parameter.
Availability: ActionScript 1.0; Flash Player 8
Parameters
pt:flash.geom.Point
1046
ActionScript classes
,
y (Rectangle.y property)
method, except that it takes a Point object as a
- A Point object to use to offset this Rectangle object.
,
width (Rectangle.width

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF