
246
Chapter 6: ActionScript Core Classes
Returns
An integer representing the length of the new array.
Description
Method; adds one or more elements to the end of an array and returns the array’s new length.
Example
The following example creates the array
myPets_array
with two elements,
cat
and
dog
. The
second line adds two elements to the array. Because the
push()
method returns the new length of
the array, the
trace()
statement in the last line sends the new length of
myPets_array
(
4
) to the
log file.
var myPets_array:Array = new Array("cat", "dog");
var pushed:Number = myPets_array.push("bird", "fish");
trace(pushed); // displays 4
See Also
Array.pop()
,
Array.shift()
,
Array.unshift()
Array.reverse()
Availability
Flash Player 5.
Usage
my_array
.reverse()
: Void
Parameters
None.
Returns
Nothing.
Description
Method; reverses the array in place.
Example
The following example uses this method to reverse the array
numbers_array
:
var numbers_array:Array = new Array(1, 2, 3, 4, 5, 6);
trace(numbers_array); // displays 1,2,3,4,5,6
numbers_array.reverse();
trace(numbers_array); // displays 6,5,4,3,2,1
Содержание FLEX-FLEX ACTIONSCRIPT LANGUAGE
Страница 1: ...Flex ActionScript Language Reference...
Страница 8: ......
Страница 66: ...66 Chapter 2 Creating Custom Classes with ActionScript 2 0...
Страница 76: ......
Страница 133: ...break 133 See also for for in do while while switch case continue throw try catch finally...
Страница 135: ...case 135 See also break default strict equality switch...
Страница 146: ...146 Chapter 5 ActionScript Core Language Elements See also break continue while...
Страница 229: ...while 229 i 3 The following result is written to the log file 0 3 6 9 12 15 18 See also do while continue for for in...
Страница 808: ...808 Chapter 7 ActionScript for Flash...
Страница 810: ...810 Appendix A Deprecated Flash 4 operators...
Страница 815: ...Other keys 815 Num Lock 144 186 187 _ 189 191 192 219 220 221 222 Key Key code...
Страница 816: ...816 Appendix B Keyboard Keys and Key Code Values...
Страница 822: ...822 Index...