261
The following example extracts the first entry in a list containing two entries that specify name,
department, and employee number information. Then the second element of the newly extracted
list is returned, identifying the department in which the first person in the list is employed. The
format of the list is [[“Dennis”, “consulting”, 510], [“Sherry”, “Distribution”, 973]], and the list is
called employeeInfoList.
firstPerson = getAt(employeeInfoList, 1)
put firstPerson
-- ["Dennis", "consulting", 510]
firstPersonDept = getAt(firstPerson, 2)
put firstPersonDept
-- "consulting"
It’s also possible to nest
getAt
commands without assigning values to variables in intermediate
steps. This format can be more difficult to read and write, but less verbose.
firstPersonDept = getAt(getAt(employeeInfoList, 1), 2)
put firstPersonDept
-- "consulting"
You can also use the bracket list access:
firstPerson = employeeInfoList[1]
put firstPerson
-- ["Dennis", "consulting", 510]
firstPersonDept = firstPerson[2]
put firstPersonDept
-- "consulting"
As with
getAt
, brackets can be nested:
firstPersonDept = employeeInfoList[1][2]
See also
getaProp
,
setaProp
,
setAt
on getBehaviorDescription
Syntax
on getBehaviorDescription
statement(s)
end
Description
System message and event handler; contains Lingo that returns the string that appears in a
behavior’s description pane in the Behavior Inspector when the behavior is selected.
The description string is optional.
Director sends the
getBehaviorDescription
message to the behaviors attached to a sprite when
the Behavior Inspector opens. Place the
on getBehaviorDescription
handler within a behavior.
The handler can contain embedded Return characters for formatting multiple-line descriptions.
Example
This statement displays “Vertical Multiline textField Scrollbar” in the description pane:
on getBehaviorDescription
return "Vertical Multiline textField Scrollbar"
end
See also
on getPropertyDescriptionList
,
on getBehaviorTooltip
,
on runPropertyDialog
Содержание DIRECTOR MX-LINGO DICTIONARY
Страница 1: ...Lingo Dictionary Macromedia Director MX...
Страница 756: ...Index 756...