Código ActionScript :
stop();
function initGallery()
{
function loadXML(loaded)
{
if (loaded)
{
xmlNode = this.firstChild;
total = xmlNode.childNodes.length;
for (i = 0; i < total; i++)
{
_root.small_image[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
_root.big_image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
_root.description[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
if (i == 0)
{
_root.loadGImage(_root.description[i], _root.big_image[i]);
}
++_root.total_images;
}
createSmall();
_root.downloadButton._visible = true;
}
else
{
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
if (_root.xml_file == undefined)
{
_root.xml_file = "images.xml";
}
xmlData.load(xml_file);
}
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;
}
_root.smallImageContainer._x = 5;
_root.smallImageContainer._y = 0;
}
function loadGImage(title, bigImgURL)
{
_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");
};
}
function goFullScreen()
{
}
function exitFullScreen()
{
}
function menuHandler(obj, menuObj)
{
{
menuObj.customItems[0].enabled = true;
menuObj.customItems[1].enabled = false;
}
{
menuObj.customItems[0].enabled = false;
menuObj.customItems[1].enabled = true;
}
}
_root.description = 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;
la estructura del xml es la siguiente
Código XML :
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <images> <pic> <image>gallery/1.jpg</image> <thumbnail>gallery/1s.jpg</thumbnail> <caption>Titulo de Muestra</caption> </pic> </images>
Espero puedan darme una mano con este tema, he visto algunos post en cristalab a cerca de colocar links a xml pero en ninguno vi una respuesta que fuese acorde a lo que busco.
GRACIAS¡¡¡¡¡
