Director Help

newMember()

Usage

-- Lingo syntax
_movie.newMember(symbol)
_movie.newMember(stringMemberType)

// JavaScript syntax
_movie.newMember(stringMemberType);

Description

Movie method; creates a new cast member and allows you to assign individual property values to child objects.

For new cast members, the symbol or stringMemberType parameter sets the cast member’s type. Possible predefined values correspond to the existing cast member types: #bitmap, #field, and so on. The newMember() method can also create Xtra cast member types, which can be identified by any name that the author chooses.

It’s also possible to create a new color cursor cast member using the Custom Cursor Xtra. Use newMember(#cursor) and set the properties of the resulting cast member to make them available for use.

After newMember() is called, the new cast member is placed in the first empty cast library slot.

To see an example of newMember() used in a completed movie, see the Parent Scripts, and Read and Write Text movies in the Learning/Lingo folder inside the Director application folder.

Parameters

symbol (Lingo only) Required. A symbol that specifies the type of the new cast member.

stringMemberType Required. A string that specifies the type of the new cast member.

Example

The following statements create a new bitmap cast member and assign it to the variable newBitmap.

-- Lingo syntax
newBitmap = _movie.newMember(#bitmap) -- using a symbol
newBitmap = _movie.newMember("bitmap") -- using a string

// JavaScript syntax
var newBitmap = _movie.newMember(symbol("bitmap")) ; //using a symbol
var newBitmap = _movie.newMember("bitmap") ; // using a string

See also

Movie, type (Member)