# Xml gallery cuztomization

**URL:** <https://forum.kirupa.com/t/xml-gallery-cuztomization/286278>\
**Category:** Uncategorized\
**Created:** [April 13, 2009, 9:47am UTC](https://forum.kirupa.com/t/xml-gallery-cuztomization/286278 "2009-04-13T09:47:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joubba](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@joubba](https://forum.kirupa.com/u/joubba)\
**Post date:** [April 13, 2009, 9:47am UTC](https://forum.kirupa.com/t/xml-gallery-cuztomization/286278/1 "2009-04-13T09:47:26Z")

</div>

help help! I’m not an action script expert and i found myself not able to solve this issue. I’m modifying a gallery (xml) and i would like to change the alpha of the thumb when it’s been selected. i tried to change the code because i did realize that every time a thumb is selected, so a big image get loaded into the main container, the script runs a function named “loadGImage”. but my code is not working even if, when i debug, it seems to me i’m working with the right instance. i attach the code of the frame ontaining the action script and i hope you can help me to solve this problem  
thanks  
joubba ![](http://forum.kirupa.com/uploads/kirupa/5337/682243cb8e95f946.gif)

function initGallery()  
{  
function loadXML(loaded)  
{  
if (loaded)  
{  
xmlNode = this.firstChild;  
total = xmlNode.childNodes.length;  
for (i = 0; i \< total; i++)  
{  
\_root.small\_image\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
\_root.big\_image\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
\_root.description\* = xmlNode.childNodes\*.childNodes[2].firstChild.nodeValue;  
if (i == 0)  
{  
\_root.loadGImage(\_root.description\*, \_root.big\_image\*, i);  
} // end if  
++\_root.total\_images;  
} // end of for  
createSmall();  
\_root.downloadButton.\_visible = true;  
}  
else  
{  
content = “file not loaded!”;  
} // end else if  
} // End of the function  
xmlData = new XML();  
xmlData.ignoreWhite = true;  
xmlData.onLoad = loadXML;  
if (\_root.xml\_file == undefined)  
{  
\_root.xml\_file = “images.xml”;  
} // end if  
xmlData.load(xml\_file);  
} // End of the function  
function createSmall()  
{  
\_root.smallContainer.createEmptyMovieClip(“smallImageContainer”, 10);  
var \_loc4 = 0;  
var \_loc3 = 0;  
for (var \_loc2 = 0; \_loc2 \< \_root.small\_image.length; ++\_loc2)  
{  
_root.smallContainer.imageContainer.attachMovie(“smallImage”, "smallImage_" + \_loc2, 100 + \_loc2);  
m = _root.smallContainer.imageContainer["smallImage_" + \_loc2];  
m.\_x = \_loc3 \* 50;  
m.\_y = 0;  
m.imageContainer.loadMovie(\_root.small\_image[\_loc2], 100);  
m.iData = Array();  
m.iData.big = \_root.big\_image[\_loc2];  
m.iData.title = \_root.description[\_loc2];  
++\_loc3;  
} // end of for  
\_root.smallImageContainer.\_x = 5;  
\_root.smallImageContainer.\_y = 0;  
} // End of the function  
function loadGImage(title, bigImgURL)  
{

[COLOR=orange]// my code   
var lunghezz = length(bigImgURL);  
var num=lunghezz-12;  
small\_thumb=".smallImage\_"+substring(bigImgURL,9,num);  
n=\_root.smallContainer.imageContainer;  
n=n+small\_thumb;  
n.\_alpha=0;  
trace(n);  
//fine my code [/COLOR]

```
_root.bigImage.imageContainer.loadMovie(bigImgURL, 100);
_root.bigImage.imageContainer._x = 0;
_root.bigImage.imageContainer._y = 0;
_root.title.text = title;
_root.downloadButton.onRelease = function ()
{
    getURL(bigImgURL, "_blank");
};

```

} // End of the function  
function menuHandler(obj, menuObj)  
{  
menuObj.customItems[0].enabled = true;  
menuObj.customItems[1].enabled = false;  
} // End of the function  
\_root.description = new Array();  
//\_root.smally = new Array();  
\_root.small\_image = new Array();  
\_root.big\_image = new Array();  
\_root.total\_images = 0;  
initGallery();  
var fullscreenCM = new ContextMenu(menuHandler);  
fullscreenCM.hideBuiltInItems();  
var fs = new ContextMenuItem(“Go Full Screen”, goFullScreen);  
fullscreenCM.customItems.push(fs);  
var xfs = new ContextMenuItem(“Exit Full Screen”, exitFullScreen);  
fullscreenCM.customItems.push(xfs);  
\_root.menu = fullscreenCM;  
downloadButton.\_visible = false;
