# Try to make a continouus floating loop banner

**URL:** <https://forum.kirupa.com/t/try-to-make-a-continouus-floating-loop-banner/290624>\
**Category:** flash\
**Created:** [June 17, 2009, 9:55am UTC](https://forum.kirupa.com/t/try-to-make-a-continouus-floating-loop-banner/290624 "2009-06-17T09:55:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![panik](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@panik](https://forum.kirupa.com/u/panik)\
**Post date:** [June 17, 2009, 9:55am UTC](https://forum.kirupa.com/t/try-to-make-a-continouus-floating-loop-banner/290624/1 "2009-06-17T09:55:13Z")

</div>

Hi first time here.  
Beginer with action actionscript and xml so be kind.

I have create an xml file with images.  
Then i go to flash i create functions untill now that they load the first image of the xml  
but now i want to load the rest of the photos the 2nd next to 1st, 3rd next to 2nd etc.  
then start the animation that the photos will floating.

**[COLOR=Black]HERE IS THE XML DATA[/COLOR]**

```auto
<?xml version="1.0" encoding="UTF-8"?>

<floatimages>

    <image>
        <imgurl>img1.jpg</imgurl>
        <imgwidth>100</imgwidth>
        <imgheight>120</imgheight>
    </image>
    <image>
        <imgurl>img2.jpg</imgurl>
        <imgwidth>100</imgwidth>
        <imgheight>120</imgheight>
    </image>
    <image>
        <imgurl>img2.jpg</imgurl>
        <imgwidth>100</imgwidth>
        <imgheight>120</imgheight>
    </image>
    <image>
        <imgurl>img3.jpg</imgurl>
        <imgwidth>100</imgwidth>
        <imgheight>120</imgheight>
    </image>
    <image>
        <imgurl>img4.jpg</imgurl>
        <imgwidth>100</imgwidth>
        <imgheight>120</imgheight>
    </image>
    <image>
        <imgurl>img5.jpg</imgurl>
        <imgwidth>100</imgwidth>
        <imgheight>120</imgheight>
    </image>
    <image>
        <imgurl>img6.jpg</imgurl>
        <imgwidth>100</imgwidth>
        <imgheight>120</imgheight>
    </image>
    <image>
        <imgurl>img7.jpg</imgurl>
        <imgwidth>100</imgwidth>
        <imgheight>120</imgheight>
    </image>
    <image>
        <imgurl>img8.jpg</imgurl>
        <imgwidth>100</imgwidth>
        <imgheight>120</imgheight>
    </image>
    <image>
        <imgurl>img9.jpg</imgurl>
        <imgwidth>100</imgwidth>
        <imgheight>120</imgheight>
    </image>
    <image>
        <imgurl>img10.jpg</imgurl>
        <imgwidth>100</imgwidth>
        <imgheight>120</imgheight>
    </image>
    <image>
        <imgurl>img11.jpg</imgurl>
        <imgwidth>100</imgwidth>
        <imgheight>120</imgheight>
    </image>
    <image>
        <imgurl>img12.jpg</imgurl>
        <imgwidth>100</imgwidth>
        <imgheight>120</imgheight>
    </image>

</floatimages>

```

**[COLOR=Black]HERE IS THE ACTIONSCRIPT CODE[/COLOR]**

```auto
var xmlRequest:URLRequest = new URLRequest("images.xml");
var xmlLoader:URLLoader = new URLLoader(xmlRequest);
var imgData:XML;
var imgLoader:Loader;
var imgString:String;
var imgNum:Number = 0;
var checkSec:Timer = new Timer(100);
var numOfchild:Number;

xmlLoader.addEventListener(Event.COMPLETE, xmlLoadedf);
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);
    imgString=imgData.image[imgNum].imgurl;
    numOfchild=imgData.*.length();
    imgLoader = new Loader;
    imgLoader.load(new URLRequest(imgString));
    mcBasic.addChild(imgLoader);

}

function checkerf(event:TimerEvent):void{
    if(imgNum == 0){
        packagedf();
    }else if(imgNum < numOfchild){
    imgLoader.unload();
    packagedf();
    }else {
    imgLoader.unload();
    imgNum=0;
    packagedf();
    }
}

```

THNX
