Senocular Preload Image Tutorial

Hi

I just tried to add a previous image button in this tutorial. But that attempt failed. :hurt:

This is the url

http://www.senocular.com/flash/source.php?id=0.132

This is the code

// baseurl to use to locate images based on SWF url not HTML url
var baseurl = _url.substr(0,_url.lastIndexOf("/")+1);
// create and position empty clips for images
// one for visible image, one which will be 
// used for preloading the next image
this.createEmptyMovieClip("one",2); // on top
this.createEmptyMovieClip("two",1);
one._x = two._x = 20;
one._y = two._y = 20;
// clips represents the clips with images
clips = [
 one,
 two
];
timeline = this; // allows reference to timeline from other clips
// images is an array of the names of the images being used
// this is for file referencing as well as status display
images = [
 "lodge",
 "ballet",
 "chess",
 "spinners",
 "tennis",
 "tribe"
];
// GetFileFor returns the file path for an image
// given its name
function GetFileFor(name){
 return baseurl+"preloadnextimage/"+name+".jpg";
}
// Preload checks to see if a clip has been loaded
function Preload(clip){
 var lod = clip.getBytesLoaded();
 var tot = clip.getBytesTotal();
 if (lod && tot){
  var percent_loaded = lod/tot;
  progress_mc._xscale = 100* percent_loaded;
  if (lod == tot){
   status_txt.text = "Preloading complete for "+images[0];
   return true; // is complete
  }
 }
 return false; // is not complete
}
// PreloadNext is used as an onEnterFrame event
// to check the loading of the current image and 
// reorders the arrays so that the first element
// now represents the next image/clip
function PreloadNext(){
 var is_complete = Preload(clips[0]);
 if (is_complete){
  clips.push(clips.shift()); // shift order of arrays
  images.push(images.shift());
  delete this.onEnterFrame;
 }
}
// FirstLoad is like PreloadNext but loads the first image
// adding in a status message otherwise handled by the next button
// and starting the second image to load when complete.
function FirstLoad(){
 var is_complete = Preload(clips[0]);
 if (is_complete){
  clips.push(clips.shift());
  images.push(images.shift());
  clips[0].loadMovie(GetFileFor(images[0]));
  status_txt.text = "Preloading "+images[0];
  this.onEnterFrame = PreloadNext;
 }
}
// next_btn.onPress shows the next image if preloaded and starts
// preloading the next one using PreloadNext as an onEnterFrame event
next_btn.onPress = function(){
 if (this.onEnterFrame){
  status_txt.text = "Please wait for "+images[0]+" to complete";
  return false;
 }
 clips[0].swapDepths(clips[1]); // move preloaded image to top
 clips[0].loadMovie(GetFileFor(images[0]));
 status_txt.text = "Preloading "+images[0];
 timeline.onEnterFrame = PreloadNext;
}
// initiate loading of first image
clips[0].loadMovie(GetFileFor(images[0]));
status_txt.text = "Preloading "+images[0];
this.onEnterFrame = FirstLoad;

Any help will greatly appreciated :nerd: