-- Lingo syntaxmemberObjRef.type // JavaScript syntaxmemberObjRef.type;
Member property; indicates a cast member's type. Read-only.
The type property can be one of the following values:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This list includes those types of cast members that are available in Director and the Xtra extensions that come with it. You can also define custom cast member types for custom cast members.
For movies created in Director 5 and 6, the type property returns #field for field cast members and #richText for text cast members. However, field cast members originally created in Director 4 return #text for the member type, providing backward compatibility for movies that were created in Director 4.
The following handler checks whether the cast member Today's News is a field cast member and displays an alert if it is not:
-- Lingo syntax
on checkFormat
if (member("Today's News").type <> #field) then
_player.alert("Sorry, this cast member must be a field.")
end if
end
// JavaScript syntax
function checkFormat() {
if (member("Today's News").type != "field") {
_player.alert("Sorry, this cast member must be a field.");
}
}