Load image issue

Hey guys, I’m stuck. I keep getting three images in the transition instead of probably two. Should I be deleting something in the code?


import fl.transitions.*;
import fl.transitions.easing.*;


var loader_mc:Loader;
var loader_xml:URLLoader = new URLLoader();
var strXML:String = "pics.xml";
var loader_url:URLRequest = new URLRequest(strXML);
var loader_urlpic:URLRequest;
var strImg:String;
var strImgNew:String;
var arrPics:Array;
var arrActualAdds:Array = new Array();
var pics:XML;
var numIMG:Number;
var timeTimer:Timer = new Timer(5000);
var perCount_num:Number = 0;
var totCount_num:Number;
timeTimer.addEventListener("timer", timeTimerA);

// Delay
var timeDelay:Timer = new Timer(15000);
timeDelay.addEventListener("timer",timeTimerB);


with(loaderbaby_mc)
{
    x = 0;
    y = 0;
}

function loadImage(url:String):void  
{
    loader_mc = new Loader();
    loader_mc.load(new URLRequest(url));
    loader_mc.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading);
    loader_mc.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
}

 
function imageLoaded(e:Event):void 
{
    loaderbaby_mc.addChild(loader_mc);
}
 
function imageLoading(e:ProgressEvent):void 
{

}

function funcEaseOut(loaderbaby_mc:MovieClip)
{
        var myTweenAlpha:Tween = new Tween(loaderbaby_mc, "alpha", Strong.easeOut, .5, 1, 3, true);    
}
function funcEaseIn(loaderbaby_mc:MovieClip)
{
        var myTweenAlpha:Tween = new Tween(loaderbaby_mc, "alpha", Strong.easeIn, 1, 0, 3, true);    
}



function showXML(e:Event):void 
{
    XML.ignoreWhitespace = true;
    pics  = new XML(e.target.data);
    trace(pics.pic.length());//Result is 4

    
    numIMG = pics.pic.length();
//    trace(pics.pic[0][email protected]);
    for(var i_num:Number = 0; i_num < numIMG; i_num++)
    {

        arrActualAdds[i_num] = pics.pic[i_num][email protected];
//        trace(arrActualAdds[i_num] + "is pic " + i_num);
    }
    strImg = arrActualAdds[0];

    funcEaseOut(loaderbaby_mc);
    loadImage(strImg);
    totCount_num =     arrActualAdds.length;
    trace(totCount_num + "= Total Count Number");
    timeDelay.start();

/*    strImg = arrActualAdds[0]; */

/*    loader_urlpic = new URLRequest(strImg);
    loadImage(strImg); */
}

function timeTimerB(eventArgs:TimerEvent):void
{
timeTimer.start();


// timeDelay.removeEventListener (TimerEvent.TIMER, timeDelay);
}

function timeTimerA(eventArgs:TimerEvent):void
{
    timeDelay.stop();
///    trace("===============================================");
    perCount_num += 1;
    if(perCount_num < totCount_num)
    {
//        trace("It's Lesser");
        // leave it alone
//        trace(perCount_num);
    }else if(perCount_num == totCount_num)
    {
                //trace("It's Greater");
        perCount_num = 0;
//        trace(perCount_num);        
    }

    strImgNew = arrActualAdds[perCount_num];
/*
    trace(strImgNew + " = " + perCount_num);
    trace("===============================================");    
*/
    loadImage(strImgNew);    
    funcEaseOut(loaderbaby_mc);


    
}



/* add one value and change the picture*/



 loader_xml.addEventListener(Event.COMPLETE, showXML);
 loader_xml.load(loader_url);
//loadImage("image30.jpg");