Here's the entire code from that section.
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.TweenLite;
import com.greensock.TimelineLite;
import com.greensock.plugins.*;
TweenPlugin.activate([FrameLabelPlugin, AutoAlphaPlugin, BlurFilterPlugin, TintPlugin, VisiblePlugin, ColorMatrixFilterPlugin]);
import fl.motion.Color;
stop();
var page=1;
trace(page);
//////////////////////////////////
//////////// PAGE 1 ////////////
//////////////////////////////////
if (page==1) {
var blockOffMc:blockOff = new blockOff();
this.addChild(blockOffMc);
blockOffMc.x=0.0;
blockOffMc.y=0.0;
// Chicklet X placement array
var testArray:Array=new Array("34","103","172","242","311","380","449","518","587","656","725","794","863");
trace(shuffleArray(testArray));
function shuffleArray(arr:Array):Array {
var len:int=arr.length;
var temp:*;
var i:int=len;
while (i--) {
var rand:int=Math.floor(Math.random()*len);
temp=arr[i];
arr[i]=arr[rand];
arr[rand]=temp;
}
return arr;
}
var myTimeline:TimelineLite = new TimelineLite();
var chickletMc:chicklet;
var yStart=934;
for (var j:Number = 0; j < 11; j++) {
yStart=yStart-72;
//Reshuffle Array
trace(shuffleArray(testArray));
//place X randomly
for (var i:int = 0; i < testArray.length; i++) {
chickletMc = new chicklet();
addChild(chickletMc);
chickletMc.alpha=0;
chickletMc.x=testArray[i];
chickletMc.y=yStart;
//myTimeline.append( new TweenLite(chickletMc, 0.75, {y:"+300", alpha:1, onStart:tweenColor}),-0.675);
myTimeline.append( new TweenLite(chickletMc, 0.4, {y:"+300", alpha:1, ease:Sine.easeInOut}),-0.375);
var myColors:Array=[0x17407C,0x247FBE,0x79CBF2];
function tweenColor():void {
var randomColor=myColors[Math.floor(Math.random()*myColors.length)];
myTimeline.append( new TweenLite(chickletMc, 0.1, {colorMatrixFilter:{colorize:randomColor, amount:2}}));
trace(randomColor);
tweenColor();
}
}
}
}