hola, necesito su ayuda urgente para poder hacer esto.
Tengo una galeria de imagenes en flash y xml, y necesito que me represente en el flash el nombre del album y su descripcion, pero no logro hacer que esto pase.
les dejo el xml:
<?xml version="1.0"?>
<photoalbum>
<parameters/>
<images>
<image imagename="foto3.jpg" infotext="11"/>
<image imagename="foto2.jpg" infotext="12"/>
<image imagename="foto1.jpg" infotext="13"/>
<image imagename="foto2.jpg" infotext="14"/>
<image imagename="foto2.jpg" infotext="15"/>
<image imagename="foto3.jpg" infotext="16"/>
</images>
<images>
<image imagename="foto3.jpg" infotext="11"/>
<image imagename="foto2.jpg" infotext="12"/>
<image imagename="foto1.jpg" infotext="13"/>
<image imagename="foto2.jpg" infotext="14"/>
<image imagename="foto2.jpg" infotext="15"/>
<image imagename="foto3.jpg" infotext="16"/>
</images>
</photoalbum>
y aqui el actionscript:
// XML PARSING
function imageListLoaded(whichalbum) {
//clear stage
for (var rr = 0; rr < noofrow * noofcolumn; rr++)
{
rr = rr + pageindex;
this["thumbframe"+rr].removeMovieClip();
this["thumbframein_mc"+rr].removeMovieClip();
rr = rr - pageindex;
}
var albumCountXML = this.imageList_xml.firstChild.childNodes;
albumCount = albumCountXML.length - 1;
var mainNode = this.imageList_xml.firstChild.childNodes[whichalbum].firstChild;
var listBoxData = createResourceList (mainNode.childNodes,pc,pr,ptx,pty,ptw,ptl);
// para nombre de album y descripcion//
album.text = albumtext;
albumname.text = whichalbum;
///////////////////////////////////
for (t=1;t<=albumCount;t++)
{
/////////////////////////////////////////////////////////////
//Creating text box
this.createEmptyMovieClip("albumnames"+t,900+t);
albumname_mc = this["albumnames"+t];
albumname_mc.createTextField("albumnametxt"+t,1000 +t,0,0,200,20);
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0x00467F;
my_fmt.font = "Century Gothic Bold"
my_fmt.size = 12;
albumname_mc["albumnametxt"+t].text = this.imageList_xml.firstChild.childNodes[t].attributes.albumname;
albumname_mc["albumnametxt"+t].setTextFormat(my_fmt);
albumname_mc._x = albumnamesx;
albumname_mc._y = albumnamesy + t * 15;
albumname_mc.sett = t;
albumname_mc.onRelease = function()
{
currentpage = 1;
filename.text = "";
for (var rr = 0; rr < noofrow * noofcolumn; rr++)
{
rr = rr + pageindex;
this["thumbframe"+rr].removeMovieClip();
this["thumbframein_mc"+rr].removeMovieClip();
rr = rr - pageindex;
}
imageListLoaded(this.sett)
_global.whichalbum = this.sett;
}
}
}
function createResourceList(resource_array,noofcolumn,noofr ow,thumbxs,thumbys,thumbwidth,thumblength,bigimage width) {
_global.noofcolumn = noofcolumn;
_global.noofrow = noofrow;
var listData = new DataProviderClass ();
resourceCount = resource_array.length;
noofpage = Math.ceil(resourceCount/(noofcolumn*noofrow));
ofof.text = "página: "+currentpage+"/"+noofpage;
var resource, image, tmb;
images = new Array();
infotexts = new Array();
pageindex =((currentpage-1) * noofrow * noofcolumn);
for (var r = 0; r < noofrow; r++)
{
for (var c = 0; c < noofcolumn; c++) {
i = (r * noofcolumn) + c + pageindex;
if(i<resourceCount)
{
nodigits = new String(resourceCount);
resource = resource_array[i];
images[i] = resource.attributes.imagename;
infotexts[i] = resource.attributes.infotext;
loadme = "imagenes/tn/"+images[i];
findme = images[i];
whichframe = "frame"+i;
this.attachMovie("thumbframe","thumbframe"+i,i+1);
this["thumbframe"+i]._x = (c * thumbwidth)+thumbxs;
this["thumbframe"+i]._y = (r * thumblength)+thumbys;
createEmptyMovieClip("thumbframein_mc"+i,(i+1)*100 0);
onEnterFrame = function()
{
for (var tr = 0; tr < noofrow; tr++)
{
for (var tc = 0; tc < noofcolumn; tc++) {
ti = (tr * noofcolumn) + tc + pageindex;
if(ti<resourceCount)
{
tw = this["thumbframein_mc"+ti]._width;
th = this["thumbframein_mc"+ti]._height;
this["thumbframein_mc"+ti]._x = this["thumbframe"+ti]._x+(thumbwidth - tw)/2;
this["thumbframein_mc"+ti]._y = this["thumbframe"+ti]._y+(thumblength - th)/2;
}
}
}
}
this["thumbframein_mc"+i].loadMovie(loadme);
noofthumbs = (currentpage-1) * noofcolumn * noofrow;
nom = noofthumbs;
callbig(nom);
this.filename.text = ""+images[nom];
this["thumbframe"+i].onPress = function()
{
startsubstring = 10;
endsubstring = startsubstring + nodigits.length;
largeindex=this._name.substring(startsubstring,end substring);
callbig(largeindex);
}
}
}
}
}
function callbig(index)
{
filename.text = ""+images[index];
info.text = infotexts[index];
imageframe_mc.createEmptyMovieClip("hold",0);
imageframe_mc.pictoral._width = _global.bigframew + 3;
imageframe_mc.pictoral._height = _global.bigframeh;
my_mcl.loadClip("imagenes/"+images[index],this.imageframe_mc.hold);
}
imageList_xml = new XML ();
imageList_xml.ignoreWhite = true;
imageList_xml.onLoad = function (success) {
if (success) {
imageListLoaded(whichalbum);
}
};
stop();
el codigo fuente lo pueden encontrar en mediaxon.com/galeria.zip
les agradezco su ayuda.