Please help with autoplay for my xml gallery!

Good day everyone,

I’m a complete beginner to flash & action script and this question will probably be easy for anyone on here (except me), this is teh first time I have ever posted on a forum ever so i hope I’m doing it right, and I’ve searched & searched all over the internet to try and get a gallery working for my website, I’ve now managed to get an xml gallery working within my flash site, but now I can’t find out how to get it to play automatically and keep repeating itself!? Ive tried learning about Timer Classes to see if I can use that but every time I try something I have errors and can’t figure out where I am going wrong, please see my whole code below as it works at the moment and any help with this will be greatly appreciated - all I want is for my images to play through and continue playing through when you go to that particular section of my site, without having to click anything first etc.

Anyway, here is the code, hope someone can help;

import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;

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

var xmlRequest:URLRequest = new URLRequest(“imageData.xml”);
var xmlLoader:URLLoader = new URLLoader(xmlRequest);
var imgData:XML;
var imageLoader:Loader;
var rawImage:String;
var rawH:String;
var rawW:String;

var imgNum:Number = 0;
var checkSec:Timer = new Timer(100);
var numberOfChildren:Number;

xmlLoader.addEventListener(Event.COMPLETE, xmlLoadedF);
master_mc.addEventListener(MouseEvent.CLICK, nextImgF);
master_mc.buttonMode = true;

function xmlLoadedF(event:Event):void{
checkSec.start();
checkSec.addEventListener(TimerEvent.TIMER, checkerF);
imgData = new XML(event.target.data);
}

function packagedF() :void{
checkSec.removeEventListener(TimerEvent.TIMER, checkerF);
rawImage = imgData.image[imgNum].imgURL;
numberOfChildren = imgData.*.length();
rawW = imgData.image[imgNum].imgW;
rawH = imgData.image[imgNum].imgH;
imageLoader = new Loader;
imageLoader.load(new URLRequest(rawImage));
master_mc.addChild(imageLoader);
imageLoader.x = (stage.stageWidth - Number(rawW)) /10;
imageLoader.y = (stage.stageHeight - Number(rawH)) /14;
new Tween(imageLoader,“alpha”,Strong.easeOut,0,1,1,true)
new Tween(imageLoader,“alpha”,Strong.easeIn,0,1,1,true)
}

function checkerF(event:TimerEvent):void{
if(imgNum == 0) {
packagedF();
}else if(imgNum < numberOfChildren) {
imageLoader.unload();
packagedF();
}else{
imageLoader.unload();
imgNum = 0;
packagedF();
}

}

function nextImgF(event:MouseEvent) :void{
checkSec.addEventListener(TimerEvent.TIMER, checkerF);
imgNum++;
}