# \[as3\]loading xml data | last added pic's

**URL:** <https://forum.kirupa.com/t/as3-loading-xml-data-last-added-pics/286504>\
**Category:** flash\
**Created:** [April 16, 2009, 12:24pm UTC](https://forum.kirupa.com/t/as3-loading-xml-data-last-added-pics/286504 "2009-04-16T12:24:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![skabszo](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@skabszo](https://forum.kirupa.com/u/skabszo)\
**Post date:** [April 16, 2009, 12:24pm UTC](https://forum.kirupa.com/t/as3-loading-xml-data-last-added-pics/286504/1 "2009-04-16T12:24:13Z")

</div>

Hi i have a small problem. I use some script of grid gallery. it works great and its based on xml file with this structure:

```php
<?xml version="1.0" encoding="utf-8"?>
<GALLERY XPOSITION="5" YPOSITION="5" WIDTH="100" HEIGHT="100">
<IMAGE FULL="full_images/image1.jpg" THUMB="thumbs/thumb1.jpg" />
<IMAGE FULL="full_images/image2.jpg" THUMB="thumbs/thumb2.jpg" />
<IMAGE FULL="full_images/image3.jpg" THUMB="thumbs/thumb3.jpg" />
<IMAGE FULL="full_images/image4.jpg" THUMB="thumbs/thumb4.jpg" />
<IMAGE FULL="full_images/image5.jpg" THUMB="thumbs/thumb5.jpg" />
<IMAGE FULL="full_images/image6.jpg" THUMB="thumbs/thumb6.jpg" />
<IMAGE FULL="full_images/image7.jpg" THUMB="thumbs/thumb7.jpg" />
<IMAGE FULL="full_images/image8.jpg" THUMB="thumbs/thumb8.jpg" />
<IMAGE FULL="full_images/image9.jpg" THUMB="thumbs/thumb9.jpg" />
<IMAGE FULL="full_images/image10.jpg" THUMB="thumbs/thumb10.jpg" />
<IMAGE FULL="full_images/image11.jpg" THUMB="thumbs/thumb11.jpg" />
<IMAGE FULL="full_images/image12.jpg" THUMB="thumbs/thumb12.jpg" />
<IMAGE FULL="full_images/image13.jpg" THUMB="thumbs/thumb13.jpg" />
<IMAGE FULL="full_images/image14.jpg" THUMB="thumbs/thumb14.jpg" />
</GALLERY>

```

In my site I want to show last added 3 thumbs. So in my site will be shown only the one thumbs which number in name of file is highest. Hm I was thinking about ‘for’ construction but i really dont know how to start;/ any ideas?I ve read that I should use sth like that:

```php

var start:int = YourXML..IMAGE.length() - 3;
for(var i:int = start; i < YourXML..IMAGE.length(); i++)
{
    //load your image here using something like:
    // YourXML..IMAGE*.@THUMB
}

```

but to be honest i really dont know how to start;/
