896
Chapter 14: Properties
// JavaScript syntax
var whichCastMember = member("Power Switch").number;
This statement assigns the cast member Red Balloon to sprite 1:
-- Lingo syntax
sprite(1).member = member("Red Balloon").number
// JavaScript syntax
sprite(1).member = member("Red Balloon").number;
This verifies that a cast member actually exists before trying to switch the cast member in
the sprite:
-- Lingo syntax
property spriteNum
on mouseUp me
if (member("Mike’s face").number > 0) then
sprite(spriteNum).member = "Mike’s face"
end if
end
// JavaScript syntax
function mouseUp() {
if (member("Mike’s face").number > 0) {
sprite(this.spriteNum).member = "Mike’s face"
}
}
See also
castLib()
,
Member
number (menus)
Usage
the number of menus
Description
Menu property; indicates the number of menus installed in the current movie.
This menu property can be tested but not set. Use the
installMenu
command to set up a custom
menu bar.
Note:
Menus are not available in Shockwave Player.
Example
This statement determines whether any custom menus are installed in the movie and, if no menus
are already installed, installs the menu Menubar:
if the number of menus = 0 then installMenu "Menubar"
This statement displays in the Message window the number of menus that are in the
current movie:
put the number of menus
See also
installMenu
,
number (menu items)
Summary of Contents for DIRECTOR MX 2004
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...