544
Chapter 12: Methods
sort
Usage
list.sort()
sort
list
Description
Command; puts list items into alphanumeric order.
•
When the list is a linear list, the list is sorted by values.
•
When the list is a property list, the list is sorted alphabetically by properties.
After a list is sorted, it maintains its sort order even when you add new variables using the
add
command.
Parameters
None.
Example
The following statement puts the list Values, which consists of [
#a: 1, #d: 2, #c: 3
], into
alphanumeric order. The result appears below the statement.
put values
-- [#a: 1, #d: 2, #c: 3]
values.sort()
put values
--[#a: 1, #c: 3, #d: 2]
sound()
Usage
-- Lingo syntax
sound(
intSoundChannel
)
// JavaScript syntax
sound(
intSoundChannel
);
Description
Top level function; returns a reference to a specified sound channel.
The functionality of this method is identical to the Sound object’s
channel()
method.
Parameters
intSoundChannel
Required. An integer that specifies the sound channel to reference.
Example
The following example assigns sound channel 1 to a variable
music
and plays a sound.
-- Lingo syntax
music = sound(1)
music.play(member("waltz1"))
// JavaScript syntax
var music = sound(1);
music.play(member("waltz1"));
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...