User Guide

438
number (cast property)
Syntax
the number of castLib whichCast
Description
Cast property; indicates the number of the specified cast. For example, 2 is the castLib number
for Cast 2.
This property can be tested but not set.
Example
This repeat loop uses the Message window to display the number of cast members that are in each
of the movies casts:
repeat with n = 1 to the number of castLibs
put castLib(n).name && "contains" && the number of \
members of castLib(n) && "cast members."
end repeat
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.
Examples
This statement assigns the cast number of the cast member Power Switch to the variable
whichCastMember:
whichCastMember = member("Power Switch").number
This statement assigns the cast member Red Balloon to sprite 1:
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:
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