i have a gallery that shows up, and when i click a button (next button) i want thumbnails to fall down and the next set to come up and space themselves. everything works fine, except the thumbnails don’t fall, they just sit there and then the next thumbnails generate themselves and spread out without the current ones falling down (they just disappear). here is my code:
function thumbsDown(whichOne) {
downTween = new mx.transitions.Tween(whichOne, "_y", mx.transitions.easing.None.easeNone, 0, 100, 10, false);
};
var currentGal:Number = 0;
var pics:Array = new Array();
var thumbs:Array = new Array();
var first10pics:Array;
var firstPic:Number = 0;
var lastPic:Number = 10;
var picsToShow:Number;
var removalThumbs:Array = new Array();
// function that executes gallery commands
function chooseGallery(whichOne:Number) {
var currentGallery = xmlGallery.firstChild.childNodes[whichOne];
var picAmount = xmlGallery.firstChild.childNodes[whichOne].childNodes.length;
for (var i:Number = 0; i < picAmount; ++i) {
pics.push(xmlGallery.firstChild.childNodes[whichOne].childNodes*.attributes.image);
thumbs.push(xmlGallery.firstChild.childNodes[whichOne].childNodes*.attributes.thumb);
}
function countImages() {
if (picAmount >= 10) {
//first10pics = pics.splice(0, 10);
//trace(pics.length);
picsToShow = 10;
spaceThumbs(picsToShow);
}
}
countImages();
function spaceThumbs(amount:Number) {
var xPositions = new Array(amount);
var spacing:Number = 45;
for (var i = amount; i > 0; i--) {
var thumbnail = "thumb" + i + "_mc";
var x = (amount - i) * spacing;
xPositions* = x;
tContainer_mc.attachMovie("thumb", thumbnail, i, {_x:0, _y:100});
tContainer_mc[thumbnail].id = i;
removalThumbs.push(thumbnail);
setTimeout(tContainer_mc[thumbnail], "thumbUp", 200 * (i + 1), tContainer_mc[thumbnail], xPositions*);
tContainer_mc[thumbnail].onRollOver = function() {
this.swapDepths(_root.getNextHighestDepth());
};
tContainer_mc[thumbnail].onRelease = function() {
_root.containerMC.loadPic(xmlGallery.firstChild.childNodes[whichOne].childNodes[this.id].attributes.image);
};
}
}
function removeThumbs() {
for (var k:Number = 0; i < 10; ++i) {
thumbsDown(removalThumbs*);
}
}
// next button
next_btn.onRelease = function() {
removeThumbs();
var fallInterval = setInterval(nextPics, 1000);
function nextPics() {
pics.splice(firstPic, lastPic);
spaceThumbs(pics.length);
clearInterval(fallInterval);
}
};
}
of course this is a stripped down version of the whole code, but it gets the idea across i think.
I appreciate the help.