beautypg.com

Tools.ctlisdown, Tools.getkeydown() – Adobe Extending Flash Professional CS5 User Manual

Page 530

background image

508

EXTENDING FLASH PROFESSIONAL

Tools object

Last updated 5/2/2011

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);

tools.ctlIsDown

Availability
Flash MX 2004.

Usage

tools.ctlIsDown

Description
Read-only property; a Boolean value that is

true

if the Control key is pressed;

false

otherwise.

Example
The following example determines whether the Control key is being pressed:

var isCtrldown = fl.tools.ctrlIsDown;

tools.getKeyDown()

Availability
Flash MX 2004.

Usage

tools.getKeyDown()

Parameters
None.

Returns
The integer value of the key.

Description
Method; returns the most recently pressed key.

This manual is related to the following products: