Pretty much what the title says. I need 6 thumbs to tween into place then start a second row. Next 6, then a third row, so on and so on. I’ll probably have it figured out by the time someone replies. Im soo brain dead right now :z:
The short:
var speed = 5;
var thumbs = new Array();
MovieClip.prototype.slideIt = function() {
this._x = Stage.width/2;
this._y = Stage.height+this._height;
this._alpha = 100;
this.onEnterFrame = function() {
this._x += (this.endX-this._x)/speed;
this._y += (this.endY-this._y)/speed;
if (Math.abs(this.endX-this._x)<1 && Math.abs(this.endY-this._y)<1) {
this._x = this.endX;
this._y = this.endY;
delete this.onEnterFrame;
}
};
};
//
portXML = new XML();
portXML.ignoreWhite = true;
portXML.onLoad = function(ok) {
if (ok) {
allData = this.firstChild.childNodes;
for (i=0; i<allData.length; i++) {
newBut = menu_mc.attachMovie('thumb', 'but'+i, i);
newBut._alpha = 0;
newBut.endX = (i*67);
newBut.endY = 0;
newBut.myText = allData*.attributes.text;
//trace(allData*.attributes.text);
newBut.myPic = allData*.firstChild.nextSibling.firstChild;
//trace(allData*.firstChild.nextSibling.firstChild);
thumbs.push(allData*.firstChild.firstChild);
//trace(allData*.firstChild.firstChild);
}
id = setInterval(loadThumbs, 500);
} else {
trace('error loading xml');
}
};
portXML.load('menu.xml');
//
var p = 0;
function loadThumbs() {
clearInterval(id);
var but = menu_mc["but"+p];
but.thumbClip.loadMovie("thumbs/"+thumbs[p]);
var temp = _root.createEmptyMovieClip("temp"+p, p);
temp.onEnterFrame = function() {
if (but.thumbClip.getBytesTotal()>4 && but.thumbClip.getBytesTotal() == but.thumbClip.getBytesLoaded()) {
nextThumb();
but.slideIt();
delete this.onEnterFrame;
}
};
}
function nextThumb() {
p<thumbs.length-1 ? (p++, loadThumbs()) : null;
}