Hi everybody,
I’m having problems making a loop of different movieClips. I’ve been able to find info about duplicating the same movieClip but I can’t seem to get it to apply to this. This is what I am working with:
I have 13 different movieClips of an animated character. They are titled montyDog_mc, montyBear_mc, montyCat_mc, etc…
I also have a next and a previous button. What I need to happen is for the movieClip animations to cycle through, one at a time, each time the user clicks the next or previous button.
I think I should be creating an array of some sort but I am very confused about how I list the movie clips in an array and apply it to the button.
This is what I have:
montyArray = new Array();
montyBear[0] = “montyBear_mc”;
montyBee[1] = “montyBee_mc”;
montyCow[2] = “montyCow_mc”;
montyDog[3] = “montyDog_mc”;
montyDuck[4] = “montyDuck_mc”;
montyFish[5] = “montyFish_mc”;
montyFox[6] = “montyFox_mc”;
montyGoat[7] = “montyGoat_mc”;
montyGoose[8] = “montyGoose_mc”;
montyHorse[9] = “montyHorse_mc”;
montyLion[10] = “montyLion_mc”;
montyPig[11] = “montyPig_mc”;
montyRat[12] = “montyRat_mc”;
montySheep[13] = “montySheep_mc”;
for(var i=0; i<montyArray.length; i++){
trace (montyArray*);
}
// NEXT AND PREVIOUS BUTTONS--------------------------------
// Next
next_mc.onRollOver = function() {
this.gotoAndPlay(“2”);
};
next_mc.onRollOut = function() {
this.gotoAndPlay(“1”);
};
next_mc.onPress = function() {
this.gotoAndPlay(“3”);
};
next_mc.onRelease = function() {
this.gotoAndPlay(“2”);
trace (montyArray*);
this._parent.holder_mc.attachMovie(“montyMain_mc”,“montyMain2_mc”,1);
};
Am I targeting the movieClips properly? Any kind of help would be greatly appreciated.