Scrollpane

Hello everyone. Thanks in advance for any help.

I am trying to load thumbnail images into a scrollpane (actionscript 2.0). I am basically loading the images into a movieclip, which becomes the contentpath for the scrollpane. My difficulty is that currenty the scrollpane appears to hang until all the images have loaded. I would like the scrollpane to refresh after each thumbnail is loaded. I have tried using refreshPane, but the entire site flickers.

Here is my setup:

I have a blank movieclip in my library that is linked to the MovieClipHolder class. This movieclip is the contentpath for the scrollpane. Here is the code within the MovieClipHolder class.


class MovieClipHolder extends MovieClip {	
	
	// Add the thumbs.
	var thumb;
	var deltaX;
	var currentlevel;
	var clipwidth:Number;
	var clipheight:Number;
	var thumbsdirectory:String = "thumbs";
	
	// Number of pics. Used throughout for looping.
	var siteCount:Number;
	var sites:Array = new Array("thumb0.jpg","thumb1.jpg","thumb2.jpg","thumb0.jpg","thumb1.jpg","thumb2.jpg","thumb0.jpg","thumb1.jpg","thumb2.jpg","thumb0.jpg","thumb1.jpg","thumb2.jpg");
	
	// Depth for attachMovie().
	var zIndex:Number = 1;
	// Used in Thumb for swapDepths() when mousing over.
	var topThumb:MovieClip;
	
	var thumbXBegin:Number = 30.4;
	var thumbYBegin:Number = 17.5;
	var buffer:Number = 4;
	
	// Number of thumbs per row.
	var thumbsPerRow:Number = 2;
	
	// Horizontal spacing between each thumb.
	var xSpacing:Number = 3;
	
	// Vertical spacing between each thumb.
	var ySpacing:Number = 3;
	
	var thumbArray:Array = new Array();
	
	//MovieClipLoader class
	var myMovieClipLoader:MovieClipLoader;
	var myMovieClipListener = new Object();      //define listener

	function MovieClipHolder () {
		init();
	}
	
	function init() {
		
		siteCount = sites.length;
		loadthumbs();
		trace(this);
		clipwidth = _level0.application.main_bg.thumbs.thumb._width;
		trace(clipwidth);
		clipheight = _level0.application.main_bg.thumbs.thumb._height;
		
		
		
		for (var i = 0; i < siteCount; i++) {
			deltaX = i - Math.floor(i / thumbsPerRow) * thumbsPerRow;
			
			thumb = attachMovie("thumb", "thumb" + i, zIndex++,
								{_x: deltaX * (clipwidth + xSpacing) + thumbXBegin + buffer,
								 _y: Math.floor(i / thumbsPerRow) * (clipheight + ySpacing) + thumbYBegin + buffer});
			
			
			
			
			thumb.setData(i, sites*);
			myMovieClipLoader.loadClip(thumbsdirectory+"/"+sites*,thumb.myLoader);
			
			thumbArray.push(thumb);
		}
	
//THIS STATEMENT BELOW CAUSE THE ENTIRE SITE TO FLICKER
	_root.application.main_bg.thumbs.myScrollPane.refreshPane();
		
		// Set the topThumb. This is used for swapDepth() when rolling over a thumb.
		topThumb = thumb;
			

	}
	

	
	
}

My guess of the problem is that when I call the refreshPane method the scrollpane’s contentPath movieclip is reloading to the point where it calls the class constructor again.

Is there a way to simply refresh the scrollpane with the current stuff in the movieclip? If not, any ideas on how to achieve a solution?

Thanks so much
Jonathan