I have two arrays - one for movieclip buttons and one for images. The idea is - rollover a button and it loads it’s respective image. I have a loop for the button array that pretty much loads each button and creates a rollover state for it. At the moment it just traces what button the mouse is over. The problem is trying to load the correct image based on that button. The way it is now - it will only load the same image for all the buttons. Here’s my code. If you have a way better way of writing or doing this, please let me know. I’m always looking to improve.
tagPosition = 0;
viciousImgs = new Array("vaI1_mc", "vaI2_mc", "vaI3_mc", "vaI4_mc", "vaI5_mc");
viciousButs = new Array("va1_mc", "va2_mc", "va3_mc", "va4_mc", "va5_mc");
vicious = new Array("vicious_mc", "uTitle_mc", "uTxt_mc", "uButs_mc", viciousImgs, viciousButs);
tagClipArray = new Array(vicious);
// button variables
introLocationY = 155;
introLocationX = 248;
tagLocationY = 193;
tagLocationX = 117;
alphaMin = 0;
alphaMax = 100;
fadeInSpeed = 30;
boxSpeed = 3;
fadeOutSpeed = 5;
//
clipArray = tagClipArray[tagPosition];
imgArr = clipArray[4];
butArr = clipArray[5];
theContainer = _root.createEmptyMovieClip(clipArray[0], _root.getNextHighestDepth());
//button functions
for (i in butArr) {
theContainer.attachMovie(butArr*, butArr*, theContainer.getNextHighestDepth(), {_x:introLocationX+i*45, _y:introLocationY});
theContainer[butArr*].onRollOver = function() {
currentButton = this;
trace(currentButton);
//figure out a way to attach images from an array via a button rollover.
trace(imgArr*);
};
}