# Action after last thumbnail has loaded

**URL:** https://forum.kirupa.com/t/action-after-last-thumbnail-has-loaded/254588
**Category:** Uncategorized
**Created:** [March 13, 2008, 12:41pm UTC](https://forum.kirupa.com/t/action-after-last-thumbnail-has-loaded/254588 "2008-03-13T12:41:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![jamiee](https://avatars.discourse-cdn.com/v4/letter/j/8baadc/32.png) [@jamiee](https://forum.kirupa.com/u/jamiee)
#### Post date: [March 13, 2008, 12:41pm UTC](https://forum.kirupa.com/t/action-after-last-thumbnail-has-loaded/254588/1 "2008-03-13T12:41:46Z")

</div>

I’m trying to find a way of unhiding “scroller\_mc” once the filnal thumbnail has loaded. I can refer to the mc’s, but the imaghes still haven’t loaded… any help will stop me going crazy.

The “onLoadComplete” function hides the “loading” mc, but it’s still before all the thumbnails have loaded.

Thanks

function loadXML(loaded) {  
if (loaded) {  
xmlNode = this.firstChild;  
image = [];  
description = [];  
thumbnails = [];  
family = [];  
ref = [];  
gender = [];  
water = [];  
ecom = [];  
rrp = [];  
middle = [];  
swfmc = [];  
total = xmlNode.childNodes.length;  
for (i=0; i\<total; i++) {  
image\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
thumbnails\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
family\* = xmlNode.childNodes\*.childNodes[3].firstChild.nodeValue;  
ref\* = xmlNode.childNodes\*.childNodes[2].firstChild.nodeValue;  
gender\* = xmlNode.childNodes\*.childNodes[4].firstChild.nodeValue;  
dialcolour\* = xmlNode.childNodes\*.childNodes[5].firstChild.nodeValue;  
description\* = xmlNode.childNodes\*.childNodes[6].firstChild.nodeValue;  
water\* = xmlNode.childNodes\*.childNodes[7].firstChild.nodeValue;  
ecom\* = xmlNode.childNodes\*.childNodes[8].firstChild.nodeValue;  
rrp\* = xmlNode.childNodes\*.childNodes[9].firstChild.nodeValue;  
middle\* = xmlNode.childNodes\*.childNodes[10].firstChild.nodeValue;  
swfmc\* = xmlNode.childNodes\*.childNodes[11].firstChild.nodeValue;  
thumbnails\_fn(i);  
}  
firstImage();  
} else {  
content = “file not loaded!”;  
}  
}  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
xmlData.load(“xml/bossladies.xml”);  
/////////////////////////////////////  
p = 1;  
function nextImage() {  
if (p\<(total-1)) {  
if (loaded == filesize) {  
\_root.prod\_info.alltext.ref\_txt.text = ref[p];  
\_root.prod\_info.alltext.family\_txt.text = family[p];  
\_root.prod\_info.alltext.gender\_txt.text = gender[p];  
\_root.prod\_info.alltext.dialcolour\_txt.text = dialcolour[p];  
\_root.prod\_info.alltext.description\_txt.text = description[p];  
\_root.prod\_info.alltext.water\_txt.text = water[p];  
\_root.prod\_info.alltext.ecom\_txt.text = ecom[p];  
\_root.prod\_info.alltext.rrp\_txt.text = rrp[p]+" GBP";  
\_root.bigwatchMc.loadMovie(image[p]);  
\_root.middleMc.loadMovie(middle[p]);  
picture\_num();  
}  
}  
}  
function picture\_num() {  
current\_pos = p+1;  
pos\_txt.text = current\_pos+" / “+total;  
}  
function thumbnails\_fn(k) {  
thumbnail\_mc.createEmptyMovieClip(“t”+k,thumbnail\_mc.getNextHighestDepth());  
tlistener = new Object();  
tlistener.onLoadInit = function(target\_mc) {  
target\_mc.pictureValue = k;  
function slide5(easeType) {  
ballTween = new mx.transitions.Tween(\_root.scrollerMc, “\_x”, easeType, 19, -231, 1, true);  
}  
target\_mc.onRelease = function() {  
p = this.pictureValue;  
slide5(mx.transitions.easing.Regular.easeOut);  
\_root.scrollerMc.vorhang.play();  
\_root.prod\_info.gotoAndPlay(10);  
\_root.createEmptyMovieClip(“middleMc”,level0);  
\_root.middleMc.\_x = 395;  
\_root.middleMc.\_y = 222;  
\_root.zoomIcon.\_visible = true;  
\_root.maskMc.enabled = true;  
nextImage();  
};  
target\_mc.\_x = target\_mc.\_width_k;  
mc\_count = (target\_mc.\_width_k)/target\_mc.\_width;  
if (mc\_count\>2) {  
target\_mc.\_y = target\_mc.\_height;  
target\_mc.\_x = (target\_mc.\_width_k)-375;  
}  
if (mc\_count\>5) {  
target\_mc.\_y = target\_mc.\_height_2;  
target\_mc.\_x = (target\_mc.\_width_k)-750;  
}  
if (mc\_count\>8) {  
target\_mc.\_y = target\_mc.\_height_3;  
target\_mc.\_x = (target\_mc.\_width_k)-1125;  
}  
if (mc\_count\>11) {  
target\_mc.\_y = target\_mc.\_height_4;  
target\_mc.\_x = (target\_mc.\_width_k)-1500;  
}  
if (mc\_count\>14) {  
target\_mc.\_y = target\_mc.\_height_5;  
target\_mc.\_x = (target\_mc.\_width_k)-1875;  
}  
if (mc\_count\>17) {  
target\_mc.\_y = target\_mc.\_height_6;  
target\_mc.\_x = (target\_mc.\_width_k)-2250;  
}  
if (mc\_count\>20) {  
target\_mc.\_y = target\_mc.\_height_7;  
target\_mc.\_x = (target\_mc.\_width_k)-2625;  
}  
if (mc\_count\>23) {  
target\_mc.\_y = target\_mc.\_height_8;  
target\_mc.\_x = (target\_mc.\_width\*k)-3000;  
}  
};  
tlistener.onLoadComplete = function() {  
\_root.scroller\_loader.\_visible = false;  
};  
image\_mcl = new MovieClipLoader();  
image\_mcl.addListener(tlistener);  
image\_mcl.loadClip(thumbnails[k],“thumbnail\_mc.t”+k);  
function closeslide(easeType) {  
closeSlide = new mx.transitions.Tween(\_root.scrollerMc, “\_x”, easeType, -269, 19, 1, true);  
}  
\_root.prod\_info.closeBtn.onPress = function() {  
unloadMovie(”\_root.middleMc");  
};  
\_root.prod\_info.closeBtn.onRelease = function() {  
closeslide(mx.transitions.easing.Regular.easeOut);  
\_root.scrollerMc.vorhang.play();  
\_root.prod\_info.gotoAndStop(1);  
};  
}
