What is an array?
An array is a list that contains a series of related items.
The first item in the array is referenced as item [0].
-----------------------------------------
Declaring and initializing the array:
Declaration and initializing are the terms used to set up the array and load the array with the initial content items.
Initializig an array to hold song files might looks like the following:
var songs:Array = [“song1.mp3”, “song2.mp3”, “song3.mp3”];
-----------------------------------------
Referencing an item:
When recalling an item from an array, and assigning the content to a variable, the array reference looks like the following: n = ArrayName[0]. You will notice that this reference returns the first item in the Array.
-----------------------------------------
WhatNext function :
The function WhatNext(NextOne) returns the next item. When the variable “NextOne” is greater than the number of items in the array, “NextOne” returns to the value of zero.
function WhatNext(NextOne):Number {
if (NextOne>songs.length-1) {
NextOne = 0;
} else {
NextOne++;
}
return NextOne;
WK01: Welcome to MultimediaMotion Graphics using AE
14 years ago