beautypg.com

Mousemove() – Adobe Extending Flash Professional CS5 User Manual

Page 42

background image

20

EXTENDING FLASH PROFESSIONAL

Top-Level Functions and Methods

Last updated 5/2/2011

Parameters

pt

A point that specifies the location of the mouse when the button is pressed. It is passed to the function when the

mouse button is pressed. This parameter is optional.

Returns
Nothing.

Description
Function; called when the extensible tool is active and the mouse button is pressed while the pointer is over the Stage.

Example
The following examples show how this function can be used when the extensible tool is active. The first example
displays a message in the Output panel that the mouse button was pressed. The second example displays the x and y
coordinates of the mouse’s location when the button was pressed.

function mouseDown() {

fl.trace("Mouse button has been pressed");

}

function mouseDown(pt) {

fl.trace("x = "+ pt.x+" :: y = "+pt.y);

}

mouseMove()

Availability
Flash MX 2004.

Usage

function mouseMove( [ pt ] ) {

// statements

}

Parameters

pt

A point that specifies the current location of the mouse. It is passed to the function whenever the mouse moves,

which tracks the mouse location. If the Stage is in edit or edit-in-place mode, the point coordinates are relative to the
object being edited. Otherwise, the point coordinates are relative to the Stage. This parameter is optional.

Returns
Nothing.

Description
Function; called whenever the extensible tool is active and the mouse moves over a specified point on the Stage. The
mouse button can be down or up.

Example
The following examples show how this function can be used. The first example displays a message in the Output panel
that the mouse is being moved. The second example displays the x and y coordinates of the mouse’s location as it
moves.

This manual is related to the following products: