I created a slideshow of movieclips to auto show not in order. Now I need to create the same slideshow of movieclips but this time in order.
can someone please help me create this function?
Here is what I did for the random function
idleInterval = setInterval(attachRandom, 3000);
function attachRandom() {
goAway();
var mcArray:Array = new Array("Animation1", "Animation2", "Animation3", "Animation4", "Animation5", "Animation6");
var ranMc:Number = Math.floor(Math.random() * mcArray.length);
var mc:MovieClip = _root.middleStage.attachMovie(mcArray[ranMc], "Animation" + [ranMc], _root.middleStage.getNextHighestDepth());
}
please help out… thanks
Try this…
var inOrderCounter:Number = 0;
var mcArray:Array = new Array("Animation1", "Animation2", "Animation3", "Animation4");
// idleInterval = setInterval(attachRandom, 3000);
idleInterval = setInterval(attachInOrder, 3000);
function attachRandom() {
goAway();
var ranMc:Number = Math.floor(Math.random() * mcArray.length);
var mc:MovieClip = _root.middleStage.attachMovie(mcArray[ranMc], "Animation" + [ranMc], _root.middleStage.getNextHighestDepth());
}
function attachInOrder() {
goAway();
if(inOrderCounter >= mcArray.length) {
inOrderCounter = 0;
}
var mc:MovieClip = _root.middleStage.attachMovie(mcArray[inOrderCounter], "Animation" + [inOrderCounter], _root.middleStage.getNextHighestDepth());
inOrderCounter++;
}
ok i got it working… but when i click on one of the buttons, the current movie clip doesn’t get remove. i tried _root.middleStage.removeMovieClip(); but nothing will happen.
advice please! :sen:
stop();
for (i=1; i<5; i++) {
this["btn"+i].iD = i;
this["btn"+i].onRelease = function() {
goAway();
clearInterval(idleInterval);
_root.currentItem1.swapDepths(300);
_root.currentItem1.removeMovieClip();
_root.currentItem1 = _root.middleStage.attachMovie("content"+this.iD, "content"+this.iD, 1);
};
}
var inOrderCounter:Number = 0;
var mcArray:Array = new Array("content1", "content2", "content3", "content4");
idleInterval = setInterval(attachInOrder, 3000);
function attachInOrder() {
goAway();
if(inOrderCounter >= mcArray.length) {
inOrderCounter = 0;
}
var mc:MovieClip = _root.middleStage.attachMovie(mcArray[inOrderCounter], "content" + [inOrderCounter], _root.middleStage.swapDepths());
inOrderCounter++;
}
function goAway() {
_root.middleStage.removeMovieClip();
}