new ListVariable()
Members
-
_createJSDOMElement :createjs.DOMElement
-
CreateJS Container for the visual display of this list variable, if shown.
Type:
- createjs.DOMElement
-
_domList :HTMLElement
-
HTML DOM element for rendering the list variable
Type:
- HTMLElement
-
_lengthSpan :HTMLElement
-
HTML DOM element for rendering the list length
Type:
- HTMLElement
-
_valueDiv :HTMLElement
-
HTML DOM element for rendering the list variable
Type:
- HTMLElement
-
_varDiv :HTMLElement
-
HTML DOM element for rendering the list variable
Type:
- HTMLElement
-
height :number
-
Height of the list variable on the stage, when shown.
Type:
- number
-
hidden :boolean
-
True if the list variable can be seen on the stage, or false if it is hidden.
Type:
- boolean
-
value :object[]
-
Type:
- object[]
-
width :number
-
Width of the list variable on the stage, when shown.
Type:
- number
-
x :number
-
X position of the list variable on the stage, when shown.
Type:
- number
-
y :number
-
Y position of the list variable on the stage, when shown.
Type:
- number
Methods
-
add(value)
-
Add an item to the end of the list
Parameters:
Name Type Description value
number | string The item to add to the list -
deleteAll()
-
Delete an item from the list
-
deleteAt(index)
-
Delete item from the list at the given index
Parameters:
Name Type Description index
number The index to delete from, 0-based. -
getAt(index) → {number|string}
-
Return item at the given index
Parameters:
Name Type Description index
number The index of the element to retrieve Returns:
The value at the given index in the list.- Type
- number | string
-
insertAt(value, index)
-
Insert item into the list at the given index
Parameters:
Name Type Description value
number | string The value to insert into the list index
number The index to insert at, 0-based. All other items are shifted towards the end of the list. -
length() → {number}
-
Returns the list of the list
Returns:
The number of items in the list- Type
- number
-
length(value) → {boolean}
-
Returns true if the list contains the given item, or false if not.
Parameters:
Name Type Description value
number | string The item to check the list for Returns:
true if the list contains the item or false if not.- Type
- boolean
-
replaceAt(value, index)
-
Replace item at the given index
Parameters:
Name Type Description value
number | string The value to replace in the list index
number The index to insert at, 0-based.