- push - add an element to the end of the array
pop - removes the last element
splice - insert/delete elements in the middle
unshift - add an element to the beginning of the array
Manipulating Arrays
- PuzzledGreatly
- Posts: 1303
- Joined: 29 Sep 2013, 22:18
Manipulating Arrays
Flash has the following methods for manipulating an array:
Re: Manipulating Arrays
Yes, but StringSplit doesn't create an array. It creates a pseudo-array; a bunch of individual variables.
If you have v1.1.13 or later, you can use StrSplit() instead. It returns an array (object).
For arrays (objects), the Insert and Remove methods cover most/all of that functionality.
If you have v1.1.13 or later, you can use StrSplit() instead. It returns an array (object).
For arrays (objects), the Insert and Remove methods cover most/all of that functionality.
-
- Posts: 60
- Joined: 03 Oct 2013, 19:49
- Location: Seattle Area
- Contact:
Re: Manipulating Arrays
.Insert(value) works like push()
.Remove() without parameters works like pop()
.Insert(1, value) inserts at the beginning
.Insert(key, value) is like splice
Objects
.Remove() without parameters works like pop()
.Insert(1, value) inserts at the beginning
.Insert(key, value) is like splice
Objects
- PuzzledGreatly
- Posts: 1303
- Joined: 29 Sep 2013, 22:18
Re: Manipulating Arrays
Thank you both for the links and examples. I'll try using strSplit()
Who is online
Users browsing this forum: mikeyww, prototype_zero, w_i_k_i_d and 337 guests