Attempting to recreate a transition effect with Actionscript

I’m a web designer by trade but my new job finds me in a position where learning Actionscript would be beneficial, as my new job doesn’t employ a developer and I’d like to eliminate the tedium of animating things by hand.

My employer likes an effect they saw on a particular site and they want me to recreate it. Here’s a description of the desired effect:

[LIST=1]
[]A series of gray bars in varying widths (but uniform height), as well as varying tints/shades, generate starting from the left of the stage and ending at the right of the stage. I’m planning to have no spacing between them, but want to have the flexibility to do so in case spacing is desired later.
[
]Starting from the left again, the bars will change color all the way across the screen. The potential colors are random and defined by an array.
[]Starting from the right, the bars will recede halfway across the stage to reveal an image.
[
]After a delay, the bars fill the entire stage again.
[*]Repeat 3/4 through a series of images either defined in the script or (preferably, if possible) pulled from an HTML element containing them.
[/LIST]
I tried to create the effect by stitching together some code from a couple of tutorials, but I broke it pretty much the instant I tried to edit it.


//build the rectangle

var rectangle:Shape = new Shape();
rectangle.graphics.beginFill(0x000000);
rectangle.graphics.drawRect(0,0,50,200);

//Random color of rectangle within array

var colorArray:Array = new Array(0xFFFF33,0xFFFFFF,0x79DCF4,0xFF3333,0xFFCC33,0x99CC33);
var randomColorID:Number = Math.floor(Math.random()*colorArray.length);
                                                                    
var myColor:ColorTransform = rectangle.transform.colorTransform;
myColor.color =colorArray[randomColorID];
rectangle.transform.colorTransform = myColor;
//0xFF0000;

//Generate multiple rectangles
var shapesNum:Number = 25;
var distance:Number = 1;

function createShapes():void {
    var X:int = 0;
    var Y:int = 0;
    
    for(var i:int= 0; i < shapesNum; i++){
//add new instance of rectangle to stage
var shape:rectangle = new rectangle();
shape.x = distance*X;

addChild(rectangle);

X++;
    }
}

function createShapes();

createShapes();

I have no knowledge of Actionscript whatsoever but I have a bare bones knowledge of PHP so I can sort-of understand the syntax. I’m not necessarily looking for someone to write the code for me, but if anyone would be willing to give me enough of a snippet to set me on the right path and some tutorials to point me in the right direction after that, I’d be grateful.