Haven’t been able to find a way to do this yet. Here’s script for my movie which loads in a xml portfolio.
function loadPicture(clip) {
var temp = this.createEmptyMovieClip("temp", 8878);
image_mc._alpha = 0;
image_mc.loadMovie(clip);
temp.onEnterFrame = function() {
//variables for your prelaoder
var t = image_mc.getBytesTotal();
var l = image_mc.getBytesLoaded();
var getPercent = l/t;
_root.loadText = Math.round(getPercent*100) + "%";
//if the inamge is loaded
if (image_mc._width) {
image_mc._alpha += 10;
if (image_mc._alpha>100) {
image_mc._alpha = 100;
delete this.onEnterFrame;
}
}
};
}
MovieClip.prototype.fader = function(thumb) {
this.onEnterFrame = function() {
this._alpha += (thumb-this._alpha)/8;
if (this._alpha>thumb-5 && this._alpha<thumb+5) {
delete this.onEnterFrame;
}
}
}
var thumb_spacing = 40;
var columns = 12; //number of columns
// load variables object to handle loading of text
var description_lv = new LoadVars();
description_lv.onData = function(raw_text){
description_txt.html = true;
description_txt.htmlText = raw_text;
}
function GeneratePortfolio(portfolio_xml) {
var portfolioPictures = portfolio_xml.firstChild.childNodes;
for (var i = 0; i<portfolioPictures.length; i++) {
var currentPicture = portfolioPictures*;
var currentThumb_mc = menu_mc.createEmptyMovieClip("thumbnail_mc"+i, i);
currentThumb_mc._x = (i%columns)*thumb_spacing;
currentThumb_mc._y = Math.floor(i/columns)*thumb_spacing;
currentThumb_mc.createEmptyMovieClip("thumb_container", 0);
currentThumb_mc.thumb_container.loadMovie(currentPicture.attributes.thumb);
currentThumb_mc.title = currentPicture.attributes.title;
currentThumb_mc.image = currentPicture.attributes.image;
currentThumb_mc.description = currentPicture.attributes.description;
currentThumb_mc.onRollOver = currentThumb_mc.onDragOver=function () {
this.fader(30);
info_txt.text = this.title;
};
currentThumb_mc.onRollOut = currentThumb_mc.onDragOut=function () {
this.fader(100);
info_txt.text = "";
};
currentThumb_mc.onRelease = function() {
loadPicture(this.image);
//image_mc.loadMovie(this.image);
description_lv.load(this.description);
};
}
//call the onRelease of the first thumb
menu_mc.thumbnail_mc0.onRelease()
}
// xml object for xml content (defines sources for selections)
var portfolio_xml = new XML();
portfolio_xml.ignoreWhite = true;
portfolio_xml.onLoad = function(success){
if (success) GeneratePortfolio(this);
else trace("Error loading XML file"); // no success? trace error (wont be seen on web)
}
// load
portfolio_xml.load("print_work.xml");
How would I go about adding an animation for my thumbnails that load in. Say like a simple timeline tween (so it can be changed easily) and also each thumb would come in sequence like a setInterval or something. As an example the first one would say zoom in then the next then the next etc. Any ideas?