314
Chapter 12: Methods
Example
This statement finds the first empty cast member on or after cast member 100:
-- Lingo syntax
trace(castLib(1).findEmpty(member(100)))
// JavaScript syntax
trace(castLib(1).findEmpty(member(100)));
See also
Cast Library
,
Member
findPos
Usage
list
.findPos(
property
)
findPos(
list
,
property
)
Description
List command; identifies the position of a property in a property list.
Using
findPos
with linear lists returns a bogus number if the value of
property
is a number and
a script error if the value of
property
is a string.
The
findPos
command performs the same function as the
findPosNear
command, except that
findPos
is
VOID
when the specified property is not in the list.
Parameters
property
Required. The property whose position is identified.
Example
This statement identifies the position of the property c in the list Answers, which consists of
[#a:10, #b:12, #c:15, #d:22]:
Answers.findPos(#c)
The result is 3, because c is the third property in the list.
See also
findPosNear
,
sort
findPosNear
Usage
sortedList
.findPosNear(
valueOrProperty
)
findPosNear(
sortedList
,
valueOrProperty
)
Description
List command; for sorted lists only, identifies the position of an item in a specified sorted list.
The
findPosNear
command works only with sorted lists. Replace
valueOrProperty
with a
value for sorted linear lists, and with a property for sorted property lists.
Содержание DIRECTOR MX 2004
Страница 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Страница 48: ...48 Chapter 2 Director Scripting Essentials...
Страница 100: ...100 Chapter 4 Debugging Scripts in Director...
Страница 118: ...118 Chapter 5 Director Core Objects...
Страница 594: ...594 Chapter 12 Methods...
Страница 684: ...684 Chapter 14 Properties See also DVD...
Страница 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Страница 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Страница 889: ...netPresent 889 _player alert Sorry the Network Support Xtras could not be found See also Player...
Страница 1102: ...1102 Chapter 14 Properties...