Ayuda con galería de fotos en XML
Hola chicos,
Os cuento, tengo una galeria hecha con XML que va de la siguiente manera:
//////////////// INITIAL VARS /////////////////////////////////////////////////////////////////////////////////
// Set first gallery displayed by default
_global.galleryNum = 1;
// Set first image displayed by default
_global.ID = 1;
// Set your document stage width and height here
var stageW = 800;
var stageH = 600;
// Set spacing amount between thumbnail images
var thumbSpace = 0;
// Set the maximum amount of thumbs to be displayed here. Scrolling will be enabled if total of thumbs is greater than default_maxThumbs
var default_maxThumbs = 15;
// Set border amount here
var border = 15;
menu_mc.bgX = menu_mc.bg._x;
// Set initial size of white bg here
destWidth = bg_mc.bg._width=400;
destHeight = bg_mc.bg._height=400;
// Alignment varibles
fullscreen_mcY = fullscreen_mc._y;
select_mcY = select_mc._y;
bgX = bg._x;
bgY = bg._y;
menu_mcX = menu_mc._x;
menu_mcY = menu_mc._y;
//////////////// CSS STYLESHEET /////////////////////////////////////////////////////////////////////////////////
var styles = new TextField.StyleSheet();
// Set hyperlink colour and decoration here
styles.setStyle("a:link", {color:'#00FFFF', textDecoration:'none'});
styles.setStyle("a:hover", {color:'#00FFFF', textDecoration:'underline'});
info_mc.txt.html = true;
info_mc.txt.styleSheet = styles;
// Hides these movieclips initially
hover_mc._visible = false;
hover_mc.startDrag([lockCenter]);
info_mc._alpha = 0;
info_mc.destAlpha = 0;
bttnNext._visible = false;
bttnPrev._visible = false;
//////////////// ON STAGE RESIZE /////////////////////////////////////////////////////////////////////////////////
stageListener = new Object();
Stage.addListener(stageListener);
alignObjects = function () {
bg._x = bgX-(Stage.width-stageW)/2;
bg._y = bgY-(Stage.height-stageH)/2;
bg._width = Stage.width;
bg._height = Stage.height;
menu_mc._x = menu_mcX-(Stage.width-stageW)/2+(Stage.width-stageW)/2;
menu_mc._y = menu_mcY+(Stage.height-stageH)/2;
menu_mc.bg._x = menu_mc.bgX-(Stage.width-stageW)/2;
menu_mc.bg._width = Stage.width;
fullscreen_mc._x = -(Stage.width-stageW)/2+Stage.width-fullscreen_mc._width-10;
fullscreen_mc._y = fullscreen_mcY+(Stage.height-stageH)/2;
select_mc._x = -(Stage.width-stageW)/2+10;
select_mc._y = select_mcY+(Stage.height-stageH)/2;
};
stageListener.onResize = function() {
alignObjects();
};
alignObjects();
//////////////// BUTTON FUNCTIONS /////////////////////////////////////////////////////////////////////////////////
bg_mc.bg.bttnNext.onRelease = function() {
nextID();
menu_mc.scroll_mc.thumb_mc["thumb"+_global.ID].selectThumb();
};
bg_mc.bg.bttnNext.onRollOver = function() {
bttnNext._visible = true;
};
bg_mc.bg.bttnNext.onRollOut = bg_mc.bg.bttnNext.onDragOut=function () {
bttnNext._visible = false;
};
bg_mc.bg.bttnPrev.onRelease = function() {
prevID();
menu_mc.scroll_mc.thumb_mc["thumb"+_global.ID].selectThumb();
};
bg_mc.bg.bttnPrev.onRollOver = function() {
bttnPrev._visible = true;
};
bg_mc.bg.bttnPrev.onRollOut = bg_mc.bg.bttnPrev.onDragOut=function () {
bttnPrev._visible = false;
};
info_bttn.bttn.onRelease = function() {
getURL(url[ID], "_blank");
};
info_bttn.bttn.onRollOver = function() {
info_mc.destAlpha = 100;
};
info_bttn.bttn.onRollOut = info_bttn.bttn.onDragOut=function () {
info_mc.destAlpha = 0;
};
nextID = function () {
if (ID0) {
_global.ID--;
loadID();
}
};
loadID = function () {
holder._alpha = -100;
info_mc._alpha = 0;
info_mc.destAlpha = 0;
bg.newHEX = Colour[_global.ID];
menu_mc.hover.txt.text = Caption[_global.ID];
loadMovie(Folder+"/"+Large[_global.ID], holder);
};
_global.thumbClick = function() {
holder._alpha = -100;
loadID();
};
//////////////// ON IMAGE LOAD /////////////////////////////////////////////////////////////////////////////////
alignPic = function () {
destWidth = holder._width;
destHeight = holder._height;
holder._x = (stageW-holder._width)/2;
holder._y = (stageH-holder._height-menu_mc._height)/2;
bg_mc.bg._width += (destWidth+border-bg_mc.bg._width)/5;
bg_mc.bg._height += (destHeight+border-bg_mc.bg._height)/5;
bg_mc.bg._x = holder._x;
bg_mc.bg._y = holder._y;
bg_mc._x = holder._width/2;
bg_mc._y = holder._height/2;
bttnNext._y = holder._y+(holder._height-bttnNext._height)/2;
bttnNext._x = bg_mc._width+(stageW-bg_mc._width)/2-bttnNext._width-border/2;
bttnPrev._y = holder._y+(holder._height-bttnPrev._height)/2;
bttnPrev._x = (stageW-bg_mc._width)/2+bttnPrev._width+border/2;
preloader._x = holder._x+holder._width/2;
preloader._y = holder._y+holder._height/2;
info_mc._x = holder._x;
info_mc._y = holder._y+holder._height-info_mc._height;
info_mc.bg._width = holder._width;
info_mc.txt.htmlText = Copy[_global.ID];
info_mc.txt._width = info_mc.bg._width-20;
info_mc.txt._x = info_mc.bg._x+10;
info_mc.txt._height = info_mc.txt.textHeight+10;
info_mc.bg._height = info_mc.txt._height+20;
};
alignPic();
//////////////// BUILD GALLERY FUNCTION //////////////////////////////////////////////////////////////////////
buildGallery = function () {
_global.ID = 0;
destWidth = 0;
destHeight = 0;
//Remove previously created photos and thumbs
for (j=0; jtotal) {
maxThumbs = total;
}
// Sets destination width and height for each image
for (n=0; n100) {
preloader.left.half._rotation = 180;
preloader.right.half._rotation = 180;
if (bg_mc.hitTest(_parent._xmouse, _parent._ymouse, true) && holder._alpha>=100) {
if (!bttnNext.hitTest(_parent._xmouse, _parent._ymouse, true) && !bttnPrev.hitTest(_parent._xmouse, _parent._ymouse, true)) {
info_mc.destAlpha = 100;
} else {
info_mc.destAlpha = 0;
}
} else {
info_mc.destAlpha = 0;
}
alignPic();
if (holder._alpha0) {
preloader.left.half._rotation = 0;
preloader.right.half._rotation = (360/100)*percentage;
} else if (percentage>50 && percentage);
stop();
Y la historia es si hay alguna manera de que no arranque desde el principio, si no al hacer click en el botón.
Mil gracias.
porelamordedios
Ya lo arreglé.
Gracias, anyway.
juandelgado
No creo que nadie se tome la molestia de leer semejante tocho de código para echarte una mano. Trata de localizar el problema y pon sólo el código necesario. Eso sin contar que tampoco sé muy bien cuál es el problema... : |