EasyManua.ls Logo

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING - Page 881

MACROMEDIA DIRECTOR MX 2004-DIRECTOR SCRIPTING
1130 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
moveableSprite 881
Description
Mouse property; contains the number of the word under the pointer when the property is called
and when the pointer is over a field sprite. Read-only.
Counting starts from the beginning of the field. When the mouse is not over a field, the result
is -1.
The value of the
mouseWord property can change in a handler or loop. If a handler or loop uses
this property multiple times, it’s usually a good idea to call the function once and assign its value
to a local variable.
Example
This statement determines whether the pointer is over a field sprite and changes the content of
the field cast member Instructions to “Please point to a word.” when it is not:
-- Lingo syntax
if (_mouse.mouseWord = -1) then
member("Instructions").text = "Please point to a word."
else
member("Instructions").text = "Thank you."
end if
// JavaScript syntax
if (_mouse.mouseWord == -1) {
member("Instructions").text = "Please point to a word.";
}
else {
member("Instructions").text = "Thank you.";
}
This statement assigns the number of the word under the pointer in the specified field to the
variable
currentWord:
-- Lingo syntax
currentWord = member(_mouse.mouseMember).word[_mouse.mouseWord]
// JavaScript syntax
var currentWord = member(_mouse.mouseMember).getProp("word",
_mouse.mouseWord);
See also
Mouse, mouseChar, mouseItem
moveableSprite
Usage
sprite(whichSprite).moveableSprite
the moveableSprite of sprite whichSprite
Description
Sprite property; indicates whether a sprite can be moved by the user (TRUE) or not (FALSE).
You can make a sprite moveable by using the Moveable option in the Score. However, to control
whether a sprite is moveable and to turn this condition on and off as needed, use Lingo. For
example, to let users drag sprites one at a time and then make the sprites unmoveable after they
are positioned, turn the
moveableSprite sprite property on and off at the appropriate times.