Flash image presentation

Hi I am trying to create a flash player to display images in sequence using Flash player & ActionScript. The code below has lots of errors and I can’t work them out. I have programmed in other languages and am perfectly aware that something like this.


var imageLoader:Loader;
imageLoader = new Loader();  // 1120: Access to undefined property imageLoader

OR


var imageLoader:Loader = new Loader(); // 1046: Type was not found or was not a compile-time: Loder

Are both acceptable.


package code 
{
    /*****************************************
     * MovieSlides :
     * Demonstrates a PPT slide show.
     * -------------------
     * See MovieSlides.fla
     ****************************************/

    import flash.events.Event;
    import flash.display.MovieClip;
    import fl.containers.UILoader;
                               
    public class MovieSlides extends MovieClip 
    {
        
    var imageLoader:Loader; 
    imageLoader = new Loader();  // Error dosen't understand previouse line.
    //var myTimer:Timer = new Timer(2000,8);
    //myTimer.addEventListener(TimerEvent.TIMER, timerListener);  // Error dosen't understand previouse line.
     var MyImages:Array = new Array(
    "S_DSC_0106.jpg","S_DSC_0218.jpg","S_DSC_0768.jpg",
    "S_DSC_0790.jpg","S_DSC_0929.jpg","S_DSC_0218.jpg"
    );
    
        public function MovieSlides() 
        {
            // constructor code
            loadImage("S_DSC_0218.jpg"); // remove & replace below
            // trace("I am here");
            // myTimer.start();
            // SitBackRelax;
        }

    

        function loadImage(url:String):void 
        { 
            // Set properties on my Loader object 
            // imageLoader = new Loader(); 
            imageLoader.load(new URLRequest(url)); 
            imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading); 
            imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded); 
        } 
  

        function SitBackRelax():void
        {
            // work through image array and call loadImage()
            // Does imageArea.addChild() ad each image? out of memmory !
        }
    }
}

The same problem is for the next two (commented out) timer lines