Automatic Slideshow in AS 3.0 using Timer class and Array

Hey guys,

i am new to AS 3.0 and still trying to grasp the new concept of oop. I have been trying to create an automatic slideshow at a click of a button. I have tried a few ways using timer class to show images(stored in an array) for a few seconds but i can’t seem to get it working. Below is the code that i am trying to get it working…if there is any kind soul out there, please help me…

// Store picture names in an array
var vPicLoader:Array = [“pix1.jpg”,“pix2.jpg”,“pix3.jpg”];

var myTimer:Timer = new Timer(2000);
myTimer.addEventListener(TimerEvent.TIMER, timerListener);

function timerListener (e:TimerEvent):void{

var picNum:Number = 0;
compUILoader.source = vPicLoader[picNum];
}

function onStartSlideShow(e:MouseEvent):void{
myTimer.start();
}

// make the button call the function to start the slideshow
slideshow_btn.addEventListener(MouseEvent.CLICK, onStartSlideshow);