ok, getting frustrated here.
I’m trying to use a loop to set up the images + buttons I need for a photo gallery, however, I can’t seem to set variable for the image to load?! this should be easier…
#include “lmc_tween.as”
/////////////
var myButtons = [this.myButton_1, this.myButton_2, this.myButton_3, this.myButton_4, this.myButton_5, this.myButton_6];
for (var i = 0; i<myButtons.length; i++) {
myButtons*.originalY = myButtons*._y;
//toLoad = Number(i+1);
//trace(toLoad);
var imageName = String("image_"+Number(i+1));
trace(imageName);
trace(myButtons*+"toload is "+imageName);
myButtons*._alpha = 0;
myButtons*.pict.loadMovie("images/homeGallery/thumbs/"+imageName+".jpg");
myButtons*.alphaTo(100, 5);
myButtons*.onRollOver = function() {
this.tween("_y", this.originalY-5, 1);
this.swapDepths(getNextHighestDepth());
};
myButtons*.onRollOut = myButtons*.onReleaseOutside=function () {
this.tween("_y", this.originalY, 0.5);
this.swapDepths(myDepth);
};
myButtons*.onRelease = function() {
this._parent.activateItem(this);
//this._parent.loadImage(this);
// When tween is finished, take alpha to zero
trace(imageName);
photo_mc._alpha = 0;
photo_mc.loadMovie("images/homeGallery/large/"+imageName+".jpg");
photo_mc.alphaTo(100, 2);
};
}
this.loadImage = function(item, toLoad) {
trace(toLoad);
};
//////
this.activateItem = function(item) {
// Function that activates a button.
// Checks if there’s an activated item already; if so, deactivates it.
if (this.currentItem != false) {
this.deActivateItem();
}
// Activates it, finally
this.currentItem = item;
this.currentItem.alphaTo(10, 1);
// makes it ‘disabled’
this.currentItem.enabled = false;
// makes it a disabled button, so it won’t receive mouse events
};
this.deActivateItem = function() {
// Deactivates the current activated menu item.
this.currentItem.enabled = true;
// back to a normal button/movieclip
this.currentItem.alphaTo(100, 0.5);
// back to its original opacity
this.currentItem.tween(“_y”, this.currentItem.originalY, 0.5);
// back to its original position
this.currentItem = undefined;
};
this.firstItem = function(item) {
this.activateItem(item);
//loadMovie(“movies/homepage/slide_interior.swf”, pictureMC);
};
this.stop();
/////////