/* Open a new FLash file (ActionScript 3.0). Select TimeLine --> Top Layer --> Frame 1 Select Window --> Actions (F9) Copy and paste this snippet Observe the output */ // /* Using loops is one easy way to manipulate arrays and seems natural for folks who are "in tune" with iterative loops. They work well for many cases. Sometimes we want or need A different approach. */ // Here's another way to manage arrays var testArray:Array = new Array(); testArray.push("remote control"); testArray.push("picture"); testArray.push("book"); testArray.push("shoes"); // Dump array for (var idx=0; idx <= testArray.length-1; idx++) { trace (idx, " " , testArray[idx]); } var throwAway:String; throwAway = testArray.pop(); throwAway = testArray.pop(); trace ("Now we try popping. Listen to see if you can hear it."); // Dump array for ( idx=0; idx <= testArray.length-1; idx++) { trace (idx, " " , testArray[idx]); }