deleteProp
291
deleteOne
Usage
list
.deleteOne(
value
)
deleteOne
list
,
value
Description
List command; deletes a value from a linear or property list. For a property list,
deleteOne
also
deletes the property associated with the deleted value. If the value appears in the list more than
once,
deleteOne
deletes only the first occurrence.
Attempting to delete a property has no effect.
Parameters
value
Required. The value to delete from the list.
Example
The first statement creates a list consisting of the days Tuesday, Wednesday, and Friday. The
second statement deletes the name Wednesday from the list.
days = ["Tuesday", "Wednesday", "Friday"]
days.deleteOne("Wednesday")
put days
The
put days
statement causes the Message window to display the result:
-- ["Tuesday", "Friday"].
deleteProp
Usage
list
.deleteProp(
item
)
deleteProp
list
,
item
Description
List command; deletes the specified item from the specified list.
•
For linear lists, replace
item
with the number identifying the list position of the item to be
deleted. The
deleteProp
command for linear lists is the same as the
deleteAt
command. If
the number is greater than the number of items in the list, a script error occurs.
•
For property lists, replace
item
with the name of the property to be deleted. Deleting a
property also deletes its associated value. If the list has more than one of the same property,
only the first property in the list is deleted.
Parameters
item
Required. The item to delete from the list.
Example
This statement deletes the color property from the list [#height:100, #width: 200, #color: 34,
#ink: 15], which is called spriteAttributes:
spriteAttributes.deleteProp(#color)
The result is the list [#height:100, #width: 200, #ink: 15].
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...