External loading function & looping

Okay, here it is…

I am loading external jpg’s whos names I have stored in an array. I have an loadProject function that is called when the user clicks a button. The attach image function fades the last image out then once it is, calls my preloadImage function. I then want to test for if the image is preloaded so that the new image can fade in…Thing is that it only wants to call the preload function and move on…(i think). So how can I loop to test if loaded and once it is, move on to the new image fade in?! I’ve with while but i get the big 'ol crash…Any ideas!!!

loadImage function:

function loadProject() {
 onEnterFrame = function () {
  _parent.masterHolder.cover.endAlpha = 100;
  if (_parent.masterHolder.cover._alpha == 100) {
   loadMovie(projPhoto, _parent.masterHolder.holder);
   preloadImage();
   do {
   trace("Loading....");
   } while (!success);
    trace("Fade new image in!");
  }
 };
}

preloadImage function:

 
function preloadImage(success) {
 onEnterFrame = function () {
  loaded = _parent.masterHolder.holder.getBytesLoaded();
  filesize = _parent.masterHolder.holder.getBytesTotal();
  percent = (loaded/filesize)*100;
  if (isNaN(percent)) {
   percent = 0;
  }
  _parent.masterHolder.percent = Math.ceil(percent)+"%";
  _parent.masterHolder.preloader.preload_bar._xscale += (percent-_parent.masterHolder.preloader.preload_bar._xscale)/3;
  if (_parent.masterHolder.preloader.preload_bar._xscale>=95 && percent == 100) {
   trace("LOADED 100%");
   delete this.onEnterFrame;
   _parent.masterHolder.preloader.preload_bar._xscale = 1;
   _parent.masterHolder.percent = "";
  }
 };
}