Arrays, random, fading

Hello all,

heres the situation, I am trying to make about 20 movie clips fade in and out randomly.This is the code I have and I thought it would work. I have been researching arrays, randomizing, loops and mroe for so long that my brain is no longer functional. If a scripting guru could help me I would be extremely appreciative. Thanks a bunch!!

This is on the main time line and I have a movieclip name grid on the stage. grid has all the mcs in it.

gridblocks = new Array();
for (var i in grid) {
grid*._alpha=0;
grid*.fade=0;
gridblocks.push(grid*);
}
fadeinCount=0;
this.onEnterFrame = function() {
count=random(gridblocks.length);
gridblocks[count].fade=1;
for (var i in gridblocks) {
if (gridblocks*.fade==1) {
gridblocks*._alpha ++;
// check if all blocks are done
if (gridblocks*._alpha==100) {
fadeinCount++;
}
}
else if (gridblocks*.fade==100) {
gridblocks*._alpha–;
}
}
}

Ok, I have kept looking and I found some more code…it is great except I want my objects to do this randomly and wihtout button prompting…Can anyone help I am desperate…

object1._alpha = 0;
//////////////////////////////
//////////////////////////////
MovieClip.prototype.alphaOut = function(alpha) {
this.onEnterFrame = function() {
this._alpha = alpha-(alpha-this._alpha)/1.2;
if (Math.abs(this._alpha-alpha)<1) {
this._alpha = alpha;
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.alphaIn = function(alpha) {
this.onEnterFrame = function() {
this._alpha = alpha-(alpha-this._alpha)/1.2;
if (Math.abs(this._alpha-alpha)<1) {
this._alpha = alpha;
delete this.onEnterFrame;
}
};
};
//////////////////////////////
//////////////////////////////
fadeIn.onPress = function() {
object1.alphaIn(100)
}
fadeOut.onPress = function() {
object1.alphaOut(0);
};