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
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;