Class: ListVariable

PodJS.ScratchPod# ListVariable

List variable containing both the list contents and the display.

Members

_createJSDOMElement :createjs.DOMElement

CreateJS Container for the visual display of this list variable, if shown.
Type:
  • createjs.DOMElement
Source:

_domList :HTMLElement

HTML DOM element for rendering the list variable
Type:
  • HTMLElement
Source:

_lengthSpan :HTMLElement

HTML DOM element for rendering the list length
Type:
  • HTMLElement
Source:

_valueDiv :HTMLElement

HTML DOM element for rendering the list variable
Type:
  • HTMLElement
Source:

_varDiv :HTMLElement

HTML DOM element for rendering the list variable
Type:
  • HTMLElement
Source:

height :number

Height of the list variable on the stage, when shown.
Type:
  • number
Source:

hidden :boolean

True if the list variable can be seen on the stage, or false if it is hidden.
Type:
  • boolean
Source:

value :object[]

Type:
  • object[]
Source:

width :number

Width of the list variable on the stage, when shown.
Type:
  • number
Source:

x :number

X position of the list variable on the stage, when shown.
Type:
  • number
Source:

y :number

Y position of the list variable on the stage, when shown.
Type:
  • number
Source:

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
Source:

deleteAll()

Delete an item from the list
Source:

deleteAt(index)

Delete item from the list at the given index
Parameters:
Name Type Description
index number The index to delete from, 0-based.
Source:

getAt(index) → {number|string}

Return item at the given index
Parameters:
Name Type Description
index number The index of the element to retrieve
Source:
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.
Source:

length() → {number}

Returns the list of the list
Source:
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
Source:
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.
Source: