This hasn’t worked. I’ve tried specifying a specific array item (mcList[0]) but to no avail. But when I put in the specific parameter, bypassing the array, it works fine. I tried passing the array item to a variable to designate what it was but this didn’t work either. So I’m guessing that setInterval can’t parse the parameter as a variable. Anyone know if there’s a way around this, or if I’m just doing something wrong?
I’ve re-written it so many times I’m not really sure where I’m at, but this is what I have at the moment. To simplify things for the time being, I’ve taken out the loop and have just been trying to get the interval to work.
var mcList:Array = new Array(“storeServers_mc”, “corpServers_mc”, “endpoints_mc”);
function startClip(clip) {
var frameTotal:Number = clip._totalframes;
var ranFrame:Number = random(frameTotal)+1;
clip.gotoAndStop(ranFrame);
}
var minTime:Number = 3000;
var maxTime:Number = 5000;
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random()*(max-min+1))+min;
return randomNum;
}
var intervalTime:Number = randRange(minTime, maxTime);
intervalID = setInterval(startClip, intervalTime, mcList[0]);
I can do a trace on mcList[0] and it spits out the right value. But there’s nothing to distinguish the parameter as a variable or object, so I’m guessing its not supported (hoping it is somehow).