tools.constrainPoint()

Availability

Flash MX 2004.

Usage

tools.constrainPoint(pt1, pt2)

Parameters

pt1 and pt2 Points that specify the starting-click point and the drag-to point.

Returns

A new adjusted or constrained point.

Description

Method; takes two points and returns a new adjusted or constrained point. If the Shift key is pressed when the command is run, the returned point is constrained to follow either a 45ยบ constrain (useful for something such as a line with an arrowhead) or to constrain an object to maintain its aspect ratio (such as pulling out a perfect square with the Rectangle tool).

Example

The following example returns a constrained point:

pt2 = fl.tools.constrainPoint(pt1, tempPt);

Flash CS3


 

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

Current page: http://livedocs.adobe.com/flash/9.0/main/00004571.html