Lingo Dictionary > L-N > member (keyword)

 

member (keyword)

Syntax

member whichCastMember
member whichCastMember of castLib whichCast
member(whichCastMember, whichCastLib)

Description

Keyword; indicates that the object specified by whichCastMember is a cast member. If whichCastMember is a string, it is used as the cast member name. If whichCastMember is an integer, it is used as the cast member number.

When playing back a movie as an applet, refer to cast members by number rather than by name to improve the applet's performance.

The member keyword is a specific reference to both a castLib and a member within it if used alone:

put sprite(12).member
-- (member 3 of castLib 2)

This property differs from the memberNum property of a sprite, which is always an integer designating position in a castLib but does not specify the castLib:

put sprite(12).memberNum
-- 3

The number of a member is also an absolute reference to a particular member in a particular castLib:

put sprite(12).member.number
-- 131075

Example

The following statement sets the hilite property of the button cast member named Enter Bid to TRUE:

member("Enter Bid").hilite = TRUE

Example

This statement puts the name of sound cast member 132 into the variable soundName:

soundName = member(132, "Viva Las Vegas").name

Example

This statement checks the type of member Jefferson Portrait in the castLib Presidents:

memberType = member("Jefferson Portrait", "Presidents").type

Example

This statement determines whether cast member 9 has a name assigned:

if member(9).name = EMPTY then exit

Example

You can check for the existence of a member by testing for its number:

memberCheck = member("Epiphany").number
if memberCheck = -1 then alert "Sorry, that member doesn't exist"

Example

Alternatively, you can check for the existence of a member by testing for its type:

memberCheck = member("Epiphany").type
if memberCheck = #empty then alert "Sorry, that member doesn't exist"

See also

memberNum