Using Point Objects - Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual

Programming actionscript 3.0
Table of Contents

Advertisement

Moving a display object by a specified angle and
distance
You can use the
polar()
by a specific angle. For example, the following code moves the
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
DisplayObjectContainer areInaccessibleObjectsUnderPoint()
BitmapData
BitmapData
Matrix
Rectangle
method of the Point class to move a display object a specific distance
Methods or properties
getObjectsUnderPoint()
hitTest()
applyFilter()
copyChannel()
merge()
paletteMap()
pixelDissolve()
threshold()
deltaTransformPoint()
transformPoint()
bottomRight
size
topLeft
object 100
myDisplayObject
Description
Used to return a list of
objects under a point in
a display object
container.
Used to define the pixel
in the BitmapData
object as well as the
point that you are
checking for a hit.
Used to define the
positions of rectangles
that define the
operations.
Used to define points
for which you want to
apply a transformation.
Used to define these
properties.

Using Point objects

419

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents