User Guide

Using Point objects 419
Moving a display object by a specified angle and
distance
You can use the polar() method of the Point class to move a display object a specific distance
by a specific angle. For example, the following code moves the
myDisplayObject object 100
pixels by 60 degrees:
import flash.geom.*;
var distance:Number = 100;
var angle:Number = 2 * Math.PI * (90 / 360);
var translatePoint:Point = Point.polar(distance, angle);
myDisplayObject.x += translatePoint.x;
myDisplayObject.y += translatePoint.y;
Other uses of the Point class
You can use Point objects with the following methods and properties:
Class Methods or properties Description
DisplayObjectContainer areInaccessibleObjectsUnderPoint()
getObjectsUnderPoint()
Used to return a list of
objects under a point in
a display object
container.
BitmapData
hitTest() Used to define the pixel
in the BitmapData
object as well as the
point that you are
checking for a hit.
BitmapData
applyFilter()
copyChannel()
merge()
paletteMap()
pixelDissolve()
threshold()
Used to define the
positions of rectangles
that define the
operations.
Matrix deltaTransformPoint()
transformPoint()
Used to define points
for which you want to
apply a transformation.
Rectangle bottomRight
size
topLeft
Used to define these
properties.