Lingo Dictionary > L-N > number (cast member property) |
![]() ![]() ![]() |
number (cast member property)
Syntax
member(
whichCastMember
).number
the number of member
whichCastMember
Description
Cast member property; indicates the cast number of the cast member specified by whichCastMember
: either a name, if whichCastMember
is a string, or a number, if whichCastMember
is an integer.
The property is a unique identifier for the cast member that is a single integer describing its location in and position in the castLib.
This property can be tested but not set.
Note: When using the first syntax of member(whichCastMember
).number, an error is generated if the cast member does not exist. When unsure of the existence of the member, use the alternate syntax to avoid the error.
Example
This statement assigns the cast number of the cast member Power Switch to the variable whichCastMember
:
whichCastMember = member("Power Switch").number
Example
This statement assigns the cast member Red Balloon to sprite 1:
sprite(1).member = member("Red Balloon").number
Example
This verifies that a cast member actually exists before trying to switch the cast member in the sprite:
property spriteNum on mouseUp me if (member("Mike's face").number > 0) then sprite(spriteNum).member = "Mike's face" end if end
See also
member (sprite property), memberNum
, number of members
![]() ![]() ![]() |