Flash 8 Image/Thumbnail Gallery Problem

Howdy,

I’m currently constructing an image gallery interface that incorporates a maximum of 20 thumbnails for each menu category. All images are extracted from an XML file.

Basically all is working the way intended, however, there’s a problem with the thumbnail section.

When the user clicks on the category in the menu, clickable thumbnails (movie clips) load in a 4x5 grid formation, together with the first large image. When you rollover the thumbnails, the alpha changes, and upon rollout they return to the up state. Also, when a thumbnail is clicked, it too changes shade until another thumbnail is clicked. THIS is all working fine!

It’s when I decide that I ALSO want the first thumbnail to be shaded upon loading (to correspond with the large image), that things go wrong. With my current code, everything works as before, except that the first thumbnail keeps this shade throughout - so its rollover become twice as dark, and it’s initial shading isn’t removed by clicking other thumbnail buttons.

If anyone has any suggestions, I’d appreciate them. Here’s the relevant sections of code…

function loadThumbnail() {
currentThumbnail = thumbsDisplayer.attachMovie(“thumbnail holder”, “thumbnail”+(tracker+1), thumbsDisplayer.getNextHighestDepth());
target = currentThumbnail.thumbImage_mc;
if ((tracker%4) == 0 && tracker != 0) {
currentRow += 1;
}
if (currentColumn>2) {
currentColumn = 0;
} else if (tracker == 0) {
currentColumn = 0;
} else {
currentColumn += 1;
}
currentThumbnail._x = currentColumnthumbMarginX;
currentThumbnail._y = currentRow
thumbMarginY;
currentThumbnail.percent_txt._visible = true;
thumbNumber = currentThumbnail._name.substr(9);
thumbPath = “gallery/”+whichGallery+"/thumbs/"+thumbNumber+".jpg";
whatIsLoading = “thumb”;
if (thumbNumber == 1) {
// create a variable to track the currently selected button
var activethumb:MovieClip;
currentThumbnail.attachMovie(“Darken_mc”,“Darken_mc”,this.getNextHighestDepth());
activethumb = this;
}

loader.loadClip(thumbPath, target);    

}

function loadAutoBigImage() {
removeMovieClip(displayBigImage);
displayBigImage = imagesHolder.attachMovie(“big image holder”, “bigImage_mc”, imagesHolder.getNextHighestDepth());
target = displayBigImage.imageHolder_mc;
bigImagePath = “gallery/”+whichGallery+"/"+1+".jpg";
whatIsLoading = “big”;
loader.loadClip(bigImagePath, target);
}

function thumbClickable():Void {
currentThumbnail.onPress = function() {
if (this != activethumb) {
activethumb.Darken_mc.removeMovieClip();
this.Darken_mc.removeMovieClip();
this.attachMovie(“Darken_mc”,“Darken_mc”,this.getNextHighestDepth());
activethumb = this;
removeMovieClip(displayBigImage);
descText.text = galleryIntros[clickedGallery];
bigNumber = this._name.substr(9);
displayBigImage = imagesHolder.attachMovie(“big image holder”, “bigImage_mc”, imagesHolder.getNextHighestDepth());
target = displayBigImage.imageHolder_mc;
bigImagePath = “gallery/”+whichGallery+"/"+bigNumber+".jpg";
whatIsLoading = “big”;

    loader.loadClip(bigImagePath, target);
    if (clickedGallery>0) {
        var descPosition:Number = 0;
        for (i=0; i<clickedGallery; i++) {
            descPosition += imagesInGallery*;
        }
        descPosition = descPosition+Number(bigNumber)-1;
        imageDesc = descriptions[descPosition];
    } else {
        imageDesc = descriptions[Number(bigNumber)-1];
    }
    descText.text = imageDesc;
    
    }
};
    
    currentThumbnail.onRollOver = function() {
    if (this != activethumb) {
    this.attachMovie("Darken_mc","Darken_mc",this.getNextHighestDepth());
    }

}
currentThumbnail.onRollOut = function() {
if (this != activethumb) {
this.Darken_mc.removeMovieClip();
}
}

};