Lingo Dictionary > A-C > cursor (sprite property)

 

cursor (sprite property)

Syntax

sprite(whichSprite).cursor = [castNumber, maskCastNumber]
set the cursor of sprite whichSprite to [castNumber, maskCastNumber]
sprite(whichSprite).cursor = whichCursor
set the cursor of sprite whichSprite to whichCursor

Description

Sprite property; determines the cursor used when the pointer is over the sprite specified by the integer expression whichSprite. This property stays in effect until you turn it off by setting the cursor to 0. Use the cursor sprite property to change the cursor when the mouse pointer is over specific regions of the screen and to indicate regions where certain actions are possible when the user clicks on them.

When you set the cursor sprite property in a given frame, Director keeps track of the sprite rectangle to determine whether to alter the cursor. This rectangle persists when the movie enters another frame unless you set the cursor sprite property for that channel to 0.

Use the syntax cursor of sprite...[castNumber, maskCastNumber] to specify the number of a cast member to use as a cursor and its optional mask.

Use the syntax cursor of sprite...whichCursor to specify default system cursors. The term whichCursor must be one of the following integer values:

0

No cursor set

-1

Arrow (pointer) cursor

1

I-beam cursor

2

Crosshair cursor

3*

Crossbar cursor

4

Watch cursor (Macintosh only)

200

Blank cursor (hides cursor)


To use custom cursors, set the cursor sprite property to a list containing the cast member to be used as a cursor or to the number that specifies a system cursor. In Windows, a cursor must be a cast member, not a resource; if a cursor is not available because it is a resource, Director displays the standard arrow cursor instead. For best results, don't use custom cursors when creating cross-platform movies.

If the sprite is a bitmap that has matte ink applied, the cursor changes only when the cursor is over the matte portion of the sprite.

When the cursor is over the location of a sprite that has been removed, rollover still occurs. Avoid this problem by not performing rollovers at these locations or by relocating the sprite up above the menu bar before deleting it.

On the Macintosh, you can use a numbered cursor resource in the current open movie file as the cursor by replacing whichCursor with the number of the cursor resource.

This property can be tested and set.

Example

This statement changes the cursor that appears over sprite 20 to a watch cursor.

Dot syntax:

sprite(20).cursor = 4

Verbose syntax:

set the cursor of sprite 20 to 4

See also

cursor (command)