Image gallery - load images one after the other automatically

hi im a beginner in flash, and flash cs3

im making a photography portfolio, using uiloader for the thumbnails and then uiloader for the large image.

i want to make the large images load one by one when the user clicks on the gallery category.

here’s the actionscript.

in one gallery, each thumbnail has its own uiloader instance, and each full image its own uiloader instance, named, image01 - 05_mc and fullimage01 - 05_mc

i want: when it clicks menu1, it loads image01, then detects when its finished loading, so it will go on to load image02, etc…

// 1) on gallery click, highlight the thumbnail button

menu1.addEventListener(MouseEvent.CLICK, image_01click);
function image_01click(evt:MouseEvent):void
{
image01_mc.alpha = 0.7;
var myRequest:URLRequest = new URLRequest(“fullimages/fullimage01.jpg”);
var myLoader:Loader = new Loader();

// 2) Make a preloader after the click.

myLoader.load(myRequest);
myLoader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showContent);
var myPreloader:Preloader = new Preloader();
function showPreloader(event:Event):void
{
addChild(myPreloader);
myPreloader.x = image01_mc.x + 97;
myPreloader.y = image01_mc.y + (image01_mc.height + 21);
}
function showProgress(event:ProgressEvent):void
{
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
myPreloader.loading_txt.text = "Loading - " + Math.round(percentLoaded * 100) + “%”;
myPreloader.bar_mc.width = image01_mc.width * percentLoaded;
}

// 3) Set the big picture to show.

function showContent(event:Event):void
{
removeChild(myPreloader);
fullimage01_mc.removeChildAt(0); //removes any other images that may overlap
fullimage01_mc.addChild(myLoader);
myLoader.y = (fullimage01_mc.height / 2) - (myLoader.height / 2);
myLoader.x = (fullimage01_mc.width / 2) - (myLoader.width / 2);

}
}

what im working on is 2 solutions, but my as3 vocabulary is very bad and nothing working for me on my syntax

something like:

  1. if load1 is complete, load 2
  2. if stage.contains a myPreloader, dont load, else load the next image.

any help and tips is greatly appreciated! thanks

fullofebak