hello
sorry for my English but I use an automatic translator
The code below is what runs my gallery.
I wish that the first image is random
anyone can help me
thank you very much
Manuel
function initGallery()
{
function loadXML(loaded)
{
if (loaded)
{
xmlNode = this.firstChild;
total = xmlNode.childNodes.length;
for (i = 0; i < total; i++)
{
small_image* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
big_image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
if (i == 0)
{
loadGImage(description*, big_image*);
} // end if
++total_images;
} // end of for
createSmall();
downloadButton._visible = true;
}
else
{
content = “file not loaded!”;
} // end else if
} // End of the function
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("bars.xml?" + casuale (9999));
} // End of the function
function createSmall()
{
smallContainer.createEmptyMovieClip(“smallImageContainer”, 10);
var _loc4 = 0;
var _loc3 = 0;
for (var _loc2 = 0; _loc2 < small_image.length; ++loc2)
{
smallContainer.imageContainer.attachMovie(“smallImage”, "smallImage" + _loc2, 100 + loc2);
m = smallContainer.imageContainer["smallImage" + _loc2];
m._x = _loc3 * 50;
m._y = 0;
m.imageContainer.loadMovie(small_image[_loc2], 100);
m.iData = Array();
m.iData.big = big_image[_loc2];
m.iData.title = description[_loc2];
++_loc3;
} // end of for
smallImageContainer._x = 5;
smallImageContainer._y = 0;
} // End of the function
function loadGImage(title, bigImgURL)
{
bigImage.imageContainer.loadMovie(bigImgURL, 100);
bigImage.imageContainer._x = 0;
bigImage.imageContainer._y = 0;
title.text = title;
downloadButton.onRelease = function ()
{
getURL(bigImgURL, “_blank”);
};
} // End of the function
description = new Array();
small_image = new Array();
big_image = new Array();
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);
menu = fullscreenCM;
downloadButton._visible = false;