898
Chapter 14: Properties
number (system)
Usage
the number of castLibs
Description
System property; returns the number of casts that are in the current movie.
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 movie’s 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 (words)
Usage
the number of words in
chunkExpression
Description
Chunk expression; returns the number of words in the chunk expression specified by
chunkExpression
.
Chunk expressions are any character, word, item, or line in any container of characters.
Containers include field cast members and variables that hold strings, and specified characters,
words, items, lines, and ranges in containers.
To accomplish this functionality with text cast members, see
count
.
Note:
The
count()
function provides a more efficient alternative for determining the number of words
in a chunk expression.
Example
This statement displays in the Message window the number of words in the string “Macromedia,
the multimedia company”:
put the number of words in "Macromedia, the multimedia company"
The result is 4.
This handler reverses the order of words in the string specified by the argument
wordList
:
on reverse wordList
theList = EMPTY
repeat with i = 1 to the number of words in wordList
put word i of wordList & " " before theList
end repeat
delete theList.char[thelist.char.count]
return theList
end
See also
count()
,
number (characters)
,
number (items)
,
number (lines)
,
word...of
Summary of Contents for DIRECTOR MX 2004-DIRECTOR SCRIPTING
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...