Objects

ActionScript provides the predefined objects described in the following tables:

Table D-11
Table D-12
Table D-13
Table D-14
Table D-15
Table D-16
Table D-17
Table D-18
Table D-19
Table D-20
Table D-21
Table D-22
Table D-23
Table D-24
Table D-25
Table D-26
Table D-27
Table D-28
Table D-29
Table D-11. Array object methods

Method name

Parameters

Description

new Array

value_list

Returns a new empty Array object, or an Array object initialized with a list of values.

Array.concat

value_list or Array

Adds a list of values to the end of an array and returns a new Array object with the concatenated values.

Array.join

separator

Returns a string constructed by concatenating each value of the Array object, separated by an optional separator string. A comma is the default separator.

Array.length

-

Returns the number of elements in the array.

Array.pop

-

Returns and removes the last element from the array.

Array.push

value_list

Adds a list of values to the end of the array and returns the new length.

Array.reverse

-

Returns a new Array object that is in the reverse order of the original.

Array.shift

-

Returns and removes the first element from the array.

Array.slice

start_index, end_index

Returns a new array that is a subrange of the target array. The returned array contains the value at the start index but not the value at the end index. Use a negative index to count from the end of the array.

Array.sort

order_function

Sorts the array in place. If the order function is not specified, elements will be sorted using the less-than (<) operator. ...

Get Perl Graphics Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.