Mi consulta es por si alguien me puede ayudar tengo una galeria que estoy modificando y tengo que ponerle un boton de Siguiente y uno de Anterior para que pase o vuelva a la foto, siguiente o anterior, si alguien me puede dar una mano?
Action Frame 1:
Código PHP:
function preload(alvo)
{
if (!alvo.doneLoading)
{
if (alvo._framesloaded > 0 && alvo._framesloaded == alvo._totalframes)
{
alvo.doneLoading = true;
_root.mov.preloader._alpha = 0;
_root.mov.preloader.preload_bar._alpha = 0;
}
else
{
_root.mov.preloader._alpha = 100;
_root.mov.preloader.preload_bar._alpha = 100;
} // end else if
var _loc3 = alvo.getBytesLoaded() / alvo.getBytesTotal();
_root.mov.preloader.preload_bar._width = _root.mov.preloader._width * _loc3;
} // end if
} // End of the function
_global.delay = 6000;
Código PHP:
function kozepre()
{
_root.mov.previewload._x = kezdoX + (kepXmax - _root.mov.previewload._width) / 2;
_root.mov.previewload._y = kezdoY + (kepYmax - _root.mov.previewload._height) / 2;
_root.mov.keret._x = kezdoX + (kepXmax - _root.mov.keret._width) / 2;
_root.mov.keret._y = kezdoY + (kepYmax - _root.mov.keret._height) / 2;
_root.mov.preloader._x = kezdoX + (kepXmax - _root.mov.preloader._width) / 2;
_root.mov.preloader._y = kezdoY + (kepYmax - _root.mov.preloader._height) / 2;
} // End of the function
stop ();
_root.mov.thumbs.carry.setMask(_root.mov.thumbs.mask);
var kepXmax = _root.mov.previewload._width;
var kepYmax = _root.mov.previewload._height;
var kezdoX = _root.mov.previewload._x;
var kezdoY = _root.mov.previewload._y;
var keret_val = 10;
_root.mov.previewload._alpha = 0;
_root.mov.keret._alpha = 0;
_root.mov.keret._width = 0;
_root.mov.keret._height = 0;
MovieClip.prototype.loadPic = function (pic)
{
_root.mov.previewload._alpha = 0;
this.loadMovie(pic);
_root.mov.onEnterFrame = function ()
{
var _loc2 = _root.mov.previewload.getBytesTotal();
var _loc3 = _root.mov.previewload.getBytesLoaded();
if (_loc2 != 0 && _loc3 / _loc2 == 1)
{
var _loc5 = _root.mov.previewload._width + keret_val;
var _loc4 = _root.mov.previewload._height + keret_val;
kozepre();
_root.mov.keret.resizeMe(_loc5, _loc4);
if (_root.mov.previewload._alpha < 100 && done)
{
_root.mov.keret._alpha = 100;
_root.mov.previewload._alpha = _root.mov.previewload._alpha + 3;
} // end if
} // end if
done = false;
};
};
MovieClip.prototype.resizeMe = function (w, h)
{
var speed = 2;
this.onEnterFrame = function ()
{
this._width = this._width + (w - this._width) / speed;
this._height = this._height + (h - this._height) / speed;
if (Math.abs(this._width - w) < 1)
{
this._width = w;
this._height = h;
kozepre();
done = true;
if (scrolling == "up" && _root.mov.thumbs.carry._y > _global.scr && _global.count > 12)
{
_root.mov.thumbs.carry._y = _root.mov.thumbs.carry._y - 57;
}
else if (scrolling == "down" && _root.mov.thumbs.carry._y < 20 && _global.count > 12)
{
_root.mov.thumbs.carry._y = _root.mov.thumbs.carry._y + 57;
} // end else if
delete this.onEnterFrame;
} // end if
};
};
Código PHP:
function loadXML(loaded)
{
if (loaded)
{
prime = new XML();
prime = this.firstChild;
totald = prime.childNodes.length;
_global.count = totald;
if (_global.count < 9)
{
_root.mov.down_b.enabled = false;
_root.mov.down_b._alpha = 30;
_root.mov.up_b.enabled = false;
_root.mov.up_b._alpha = 30;
} // end if
d_thumb = [];
d_img = [];
s = 1;
j = 1;
for (i = 0; i < totald; i++)
{
d_thumb[i] = prime.childNodes[i].attributes.thumb;
d_img[i] = prime.childNodes[i].attributes.img;
elem = _root.mov.thumbs.carry.loader.attachMovie("t_el", "t_el" + i, i);
elem.img_store = d_img[i];
elem._width = 50;
elem._height = 50;
elem._x = j * elem._width * 1.155000E+000;
elem._y = s * elem._height * 1.144000E+000;
_global.eh = elem._height;
++j;
if (elem._x > 2 * elem._width)
{
++s;
j = 1;
} // end if
thumblink = d_thumb[i];
elem.thumbload.loadMovie(thumblink);
_global.scr = -(_root.mov.thumbs.carry._height - 8 * elem._height);
elem.onRollOver = function ()
{
this._alpha = 27;
};
elem.onDragOver = function ()
{
this._alpha = 27;
};
elem.onRollOut = function ()
{
this._alpha = 100;
};
elem.onDragOut = function ()
{
this._alpha = 100;
};
elem.onRelease = function ()
{
_root.mov.previewload._alpha = 0;
_root.mov.previewload.loadPic(this.img_store);
};
} // end of for
_root.mov.previewload.loadPic(_root.mov.thumbs.carry.loader.t_el0.img_store);
} // end if
} // End of the function
_global.playvalid = false;
datax = new XML();
XML.prototype.ignoreWhite = true;
datax.onLoad = loadXML;
datax.load(_global.load_xml);
y con un xml
gallery.xml
Código PHP:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data>
<pic thumb="galeria/thm/001.JPG" img="galeria/001.JPG"></pic>
<pic thumb="galeria/thm/002.JPG" img="galeria/002.JPG"></pic>
<pic thumb="galeria/thm/003.JPG" img="galeria/003.JPG"></pic>
<pic thumb="galeria/thm/004.JPG" img="galeria/004.JPG"></pic>
<pic thumb="galeria/thm/005.JPG" img="galeria/005.JPG"></pic>
<pic thumb="galeria/thm/006.JPG" img="galeria/006.JPG"></pic>
<pic thumb="galeria/thm/007.JPG" img="galeria/007.JPG"></pic>
<pic thumb="galeria/thm/008.JPG" img="galeria/008.JPG"></pic>
<pic thumb="galeria/thm/009.JPG" img="galeria/009.JPG"></pic>
<pic thumb="galeria/thm/010.JPG" img="galeria/010.JPG"></pic>
<pic thumb="galeria/thm/011.JPG" img="galeria/011.JPG"></pic>
<pic thumb="galeria/thm/012.JPG" img="galeria/012.JPG"></pic>
</data>