User Guide

371
The member sprite property differs from the memberNum sprite property, which specifies only the
sprites number to identify its location in the cast but doesnt specify the cast itself. The
member
sprite property also differs from mouseMember and the obsolete castNum sprite properties, neither
of which specifies the sprite’s cast.
When assigning a sprites
member property, use one of the following formats:
Specify the full member and cast description (sprite(x).member = member(A, B) .
Specify the cast member name (sprite(x).member = member ("MELODY ").
Specify the unique integer that includes all cast libraries and corresponds to the mouseMember
function (
sprite(x).member = 132) .
If you use only the cast member name, Director finds the first cast member that has that name in
all current casts. If the name is duplicated in two casts, only the first name is used.
To specify a cast member by number when there are multiple casts, use the
memberNum sprite
property, which changes the member’s position in its cast without affecting the sprites cast (
set
the memberNum of sprite x to 132
).
You can determine the
memberNum sprite property from the member sprite property by using the
phrase
the number of the member of sprite x. You can also retrieve other cast member
properties by using phrases such as the name of the member of sprite x or the rect of
the member of sprite x
.
The cast member assigned to a sprite channel is only one of that sprites properties; other
properties vary by the type of media element in that channel in the Score. For example, if you
replace a bitmap with an unfilled shape by setting the
member sprite property, the shape sprites
lineSize sprite property doesnt automatically change, and you probably wont see the shape.
Similar sprite property mismatches can occur if you change the member of a field sprite to a
video. Although you can change all sprite properties through the
type sprite property, it’s
generally more useful and predictable to replace cast members with similar cast members. For
example, replace bitmap sprites with bitmap cast members.
This property can be tested and set.
Examples
This statement assigns cast member 3 of cast number 4 to sprite 15:
sprite(15).member = member(3, 4)
The following handler uses the mouseMember function with the sprite.member property to find if
the mouse is over a particular sprite:
on exitFrame
MM = the mouseMember
target = sprite(1).member
if target = MM then put "above the hotspot"
go the frame
end
See also
castLibNum, memberNum