cursor()

Usage

-- Lingo syntax
_player.cursor(intCursorNum)
_player.cursor(cursorMemNum, maskMemNum)
_player.cursor(cursorMemRef)

// JavaScript syntax
_player.cursor(intCursorNum);
_player.cursor(cursorMemNum, maskMemNum);
_player.cursor(cursorMemRef);

Description

Player method; changes the cast member or built-in cursor that is used for a cursor and stays in effect until you turn it off by setting the cursor to 0.

During system events such as file loading, the operating system may display the watch cursor and then change to the pointer cursor when returning control to the application, overriding the cursor command settings from the previous movie. To use cursor() at the beginning of any new movie that is loaded in a presentation using a custom cursor for multiple movies, store any special cursor resource number as a global variable that remains in memory between movies.

Cursor commands can be interrupted by an Xtra or other external agent. If the cursor is set to a value in Director and an Xtra or external agent takes control of the cursor, resetting the cursor to the original value has no effect because Director doesn't perceive that the cursor has changed. To work around this, explicitly set the cursor to a third value and then reset it to the original value.

Parameters

intCursorNum Required when using an integer to identify a cursor. An integer that specifies the built-in cursor to use as a cursor.

cursorMemNum Required when using a cast member number and its optional mask to identify the cursor. An integer that specifies the cast member number to use as a cursor.

maskMemNum Required when using a cast member number and its optional mask to identify the cursor. An integer that specifies the mask number of cursorMemNum.

cursorMemRef Required when using a cast member reference to identify the cursor. A reference to the cast member to use as a cursor.

Example

This statement changes the cursor to a watch cursor on the Macintosh, and hourglass in Windows, whenever the value in the variable named status equals 1:

-- Lingo syntax syntax
if (status = 1) then
   _player.cursor(4)
end if

// JavaScript syntax
if (status == 1) {
   _player.cursor(4);
}

This handler checks whether the cast member assigned to the variable is a 1-bit cast member and then uses it as the cursor if it is:

-- Lingo syntax syntax
on myCursor(someMember)
   if (member(someMember).depth = 1) then
      _player.cursor(someMember)
   else
      _sound.beep()
   end if
end

// JavaScript syntax
function myCursor(someMember) {
   if (member(someMember).depth == 1) {
      _player.cursor(someMember);
   }
   else {
      _sound.beep();
   }
}

See also

Player