# Preload problem

**URL:** <https://forum.kirupa.com/t/preload-problem/52471>\
**Category:** Uncategorized\
**Created:** [May 24, 2004, 12:38pm UTC](https://forum.kirupa.com/t/preload-problem/52471 "2004-05-24T12:38:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![calculating\_inf](https://avatars.discourse-cdn.com/v4/letter/c/59ef9b/32.png) [@calculating\_inf](https://forum.kirupa.com/u/calculating_inf)\
**Post date:** [May 24, 2004, 12:38pm UTC](https://forum.kirupa.com/t/preload-problem/52471/1 "2004-05-24T12:38:08Z")

</div>

Hi, I seem to have some troubles preloading some images.  
The imagepaths come from a xml file (but that doesnt really matter here)  
I already figured out that an MC looses its capability to onEnterFrame when you load a movie in it (loadMovie).  
The problem is that he only preloads the last image. can’t figure out why.  
traced my \*\*\* off…

numberOfFields = number of Links To Images in the xml file

for (var i=0; i\<numberOfFields; i++)  
{  
thisField = formFields\*;  
thisFieldProperties = thisField.attributes;  
thisFieldLink = thisFieldProperties.picLink;

depth = myForm\_mc\_global.photos\_mc.getNextHighestDepth();  
lomo\_mc = photos\_mc.createEmptyMovieClip(“lomo\_”+i+"\_mc",depth);  
preload\_mc = lomo\_mc.createEmptyMovieClip(“preload\_mc”,lomo\_mc.getNextHighestDepth());  
lomo\_mc.\_alpha = 0;  
preload\_mc.loadMovie(thisFieldLink);

lomo\_mc.onEnterFrame = function()  
{  
var totaal = lomo\_mc.getBytesTotal();  
var aantal = getBytesLoaded();  
trace(totaal);  
if(aantal \>= totaal)  
{  
//images is ingeladen  
lomo\_mc.\_alpha = 30;  
delete this.onEnterFrame;  
}  
}  
}

thanx a lot!

ward.
