offset (Point.offset method)

public offset(dx:Number, dy:Number) : Void

Offsets the Point object by the specified amount. The value of dx is added to the original value of x to create the new x value. The value of dy is added to the original value of y to create the new y value.

Availability: ActionScript 1.0; Flash Player 8

Parameters

dx:Number - The amount by which to offset the horizontal coordinate, x.

dy:Number - The amount by which to offset the vertical coordinate, y.

Example

The following example offsets a point's position by specified x and y amounts.

import flash.geom.Point;
var myPoint:Point = new Point(1, 2);
trace(myPoint.toString()); // (x=1, y=2)
myPoint.offset(4, 8);
trace(myPoint.toString()); // (x=5, y=10) 

See also

add (Point.add method)


Version 8

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00002601.html