# Image Gallery via XML help

**URL:** <https://forum.kirupa.com/t/image-gallery-via-xml-help/262299>\
**Category:** flash\
**Created:** [June 4, 2008, 7:50pm UTC](https://forum.kirupa.com/t/image-gallery-via-xml-help/262299 "2008-06-04T19:50:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![colorful\_tones](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/colorful_tones/32/3009_2.png) [@colorful\_tones](https://forum.kirupa.com/u/colorful_tones)\
**Post date:** [June 4, 2008, 7:50pm UTC](https://forum.kirupa.com/t/image-gallery-via-xml-help/262299/1 "2008-06-04T19:50:36Z")

</div>

Hi,  
I have a swf with an embedded image of a map. Over the map I’ve placed several movieClip buttons to represent different locations on the map. I’ve managed to put together a simple reusable button class that allows for the hover and out effects on each location. I’d like to include in my button class a CLICK event which would trigger the population of a TileList, therefore each button/location when clicked would populate the TileList with unique set of images and then when an image is clicked in TileList a larger image is displayed on top of everything and then click the larger image to remove and browse some more. I feel like I’m close, but not really?! I’m attaching a copy of my button class.  
I imagine I need to create an XML loading class, separate my XML file into sets of images, and voila

---

<div class="post-metadata">

**Author:** ![sudhansurana](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@sudhansurana](https://forum.kirupa.com/u/sudhansurana)\
**Post date:** [June 5, 2008, 9:31am UTC](https://forum.kirupa.com/t/image-gallery-via-xml-help/262299/2 "2008-06-05T09:31:29Z")

</div>

I would suggest you rather build your ButtonEvent class and despatch the click event .In the stage you add the eventListener functions. while creating the myButtonClass add the path of the xml from which you want to extract the image path.When you click the button stage will know and load the xml .After the xml is loaded call the function to create a dynamic Tile list and load the image in the TileList.The rest is what you want…

Cheers  
Sudhansu

---

<div class="post-metadata">

**Author:** ![Alex\_Lexcuk](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@Alex\_Lexcuk](https://forum.kirupa.com/u/Alex_Lexcuk)\
**Post date:** [June 5, 2008, 1:16pm UTC](https://forum.kirupa.com/t/image-gallery-via-xml-help/262299/3 "2008-06-05T13:16:43Z")

</div>

```auto

var my_but= new My_button_mc("txt",my_func_stop);
addChild(my_but);
with (my_but) {x=10;y=10; scaleX=0.5; scaleY=0.5;}
function my_func_stop()
{
url_func(my_array[0]);
}

```

my\_array[0] has load from file  
[http://dnadillo.dn.ua/fla/external\_url/ext\_url.txt](http://dnadillo.dn.ua/fla/external_url/ext_url.txt)  
line 0

test from  
[http://dnadillo.dn.ua/fla/external\_url/ext-url.swf](http://dnadillo.dn.ua/fla/external_url/ext-url.swf)

[http://dnadillo.dn.ua/fla/external\_url/ext\_url.zip](http://dnadillo.dn.ua/fla/external_url/ext_url.zip)

xml model  
[http://dnadillo.dn.ua/fla/XML/img-xml.swf](http://dnadillo.dn.ua/fla/XML/img-xml.swf)

load image url from external xml file in sprite  
[http://dnadillo.dn.ua/fla/XML/img-xml-img.swf](http://dnadillo.dn.ua/fla/XML/img-xml-img.swf)  
[http://dnadillo.dn.ua/fla/XML/img-xml-img.zip](http://dnadillo.dn.ua/fla/XML/img-xml-img.zip)  
[http://dnadillo.dn.ua/fla/XML/img\_xml.xml](http://dnadillo.dn.ua/fla/XML/img_xml.xml)

---

<div class="post-metadata">

**Author:** ![sudhansurana](https://avatars.discourse-cdn.com/v4/letter/s/50afbb/32.png) [@sudhansurana](https://forum.kirupa.com/u/sudhansurana)\
**Post date:** [June 6, 2008, 9:30am UTC](https://forum.kirupa.com/t/image-gallery-via-xml-help/262299/4 "2008-06-06T09:30:56Z")

</div>

Hi  
I have worked on the problem you told.  
I mm attaching the zip file .You can use it as your additional source.

Cheers:devious:  
Sudhansu

i couldnot add .pngs uou add of your own and the .png size should be 80x80 pixels
