ActionScript Code:
//Lets say menuXML.gallery has 10 items
var i = 0 ;
for each (var item in menuXML.gallery.imageFile){
//i goes from 0 - 9 here !!
newSlide();
//i gets incremented here . Remember the last value of i is not 9 but 10 because it is incremented and this is the value that gets fed in when the timer completes
i++;
//->>>>>>>>>>>>>>>>>>>>>>>>>>>OUT OF THE LOOP
tenSecondTimer.addEventListener(TimerEvent.TIMER, unWait);
//Doesnt matter where you define this function . it will always be called after 10 seconds .If fps is 32 it wil be called after 320 frames.
//Doesnt matter how many items you have in the imageFile when unwait is called i is always 10 unless u have reset it
//OOPS imageFile[10] doesnt exist
//You just defined a function umm 10 times? but why?
function unWait(evt:TimerEvent){newSlide();}
//Fails!!!!!
tenSecondTimer.start();
//->>>>>>>>>>>>>>>>>>>>>>>>>>OUT OF THE LOOP
}//While we got nodes
Alright here is my explanation of your code. May be you might have to rethink your logic a little bit.
p.s try not nesting functions. it is easier to debug that way