Comunidad de diseño web y desarrollo en internet online

ayuda a poner links ala imagenes

Citar            
MensajeEscrito el 16 Ago 2007 04:00 pm
hola por favor me pueden ayudar tengo una galeria de fotos echa en flash y xml bueno aparentemente funciona todo bien lo que nesist oes ponerle un link a cada fotoa que va lla pasando y me lleve a un documento html, el xml ya esta definido las imagenes por id y tienen un url lo que no consigo es poner en el action scriot la fuuncion para hacer el on release y el get url respectivo de cada iamagen lo que nensisto es poner el vinculo a cada iamagen para que me lleve a cada html respectvio.

les pongo el codigo que utlizo a ver si me pueden dar un mano es urgente por favor gracias.

xml:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image id="pic0.jpg" url = "index.htm"/>
<caption>Alergizina</caption>
</pic>
<pic>
<image id="pic1.jpg" url = "index.htm"/>
<caption>Alergizina</caption>
</pic>
<pic>
<image id="pic2.jpg" url = "index.htm"/>
<caption>Alergizina</caption>
</pic>
<pic>
<image id="pic3.jpg" url = "index.htm"/>
<caption>BB Nasal</caption>
</pic>
<pic>
<image id="pic4.jpg" url = "index.htm"/>
<caption>BB Nasal</caption>
</pic>
<pic>
<image id="pic5.jpg" url = "index.htm"/>
<caption>Cipropharma</caption>
</pic>
<pic>
<image id="pic6.jpg" url = "index.htm"/>
<caption>Cipropharma</caption>
</pic>
<pic>
<image id="pic7.jpg" url = "index.htm"/>
<caption>Cipropharma</caption>
</pic>
<pic>
<image id="pic8.jpg" url = "index.htm"/>
<caption>Doloir</caption>
</pic>
<pic>
<image id="pic9.jpg" url = "index.htm"/>
<caption>Doloir</caption>
</pic>
<pic>
<image id="pic10.jpg" url = "index.htm"/>
<caption>Doloir</caption>
</pic>
<pic>
<image id="pic11.jpg" url = "index.htm"/>
<caption>Dolomes</caption>
</pic>
<pic>
<image id="pic12.jpg" url = "index.htm"/>
<caption>Dolomes</caption>
</pic>
<pic>


sction script:

delay = 4000;
//-----------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].attributes.id;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
////////////////////////
////////////////
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
slideshow();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
slideshow();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
}

Por joselo

10 de clabLevel



Genero:Masculino  

msie
Citar            
MensajeEscrito el 16 Ago 2007 05:14 pm

Código :

delay = 4000;
var arrURL:Array = new Array();
//-----------------------
function loadXML(loaded) {
   if (loaded) {
      xmlNode = this.firstChild;
      image = [];
      description = [];
      total = xmlNode.childNodes.length;
      for (i=0; i<total; i++) {
         image[i] = xmlNode.childNodes[i].childNodes[0].attributes.id;
         description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
         arrURL[i] = xmlNode.childNodes[i].childNodes[0].attributes.url;
      }
      firstImage();
   } else {
      content = "file not loaded!";
   }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
   if (Key.getCode() == Key.LEFT) {
      prevImage();
   } else if (Key.getCode() == Key.RIGHT) {
      nextImage();
   }
};
Key.addListener(listen);
previous_btn.onRelease = function() {
   prevImage();
};
next_btn.onRelease = function() {
   nextImage();
};
/////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
   if (Key.getCode() == Key.LEFT) {
      prevImage();
   } else if (Key.getCode() == Key.RIGHT) {
      nextImage();
   }
};
p = 0;
this.onEnterFrame = function() {
   filesize = picture.getBytesTotal();
   loaded = picture.getBytesLoaded();
   preloader._visible = true;
   if (loaded != filesize) {
      preloader.preload_bar._xscale = 100*loaded/filesize;
   } else {
      preloader._visible = false;
      if (picture._alpha<100) {
         picture._alpha += 10;
      }
   }
};
////////////////////////
////////////////
function nextImage() {
   if (p<(total-1)) {
      p++;
      if (loaded == filesize) {
         picture._alpha = 0;
         cargarImg(image[p]);
         desc_txt.text = description[p];
         picture_num();
         slideshow();
      }
   }
}
function prevImage() {
   if (p>0) {
      p--;
      picture._alpha = 0;
      cargarImg(image[p]);
      desc_txt.text = description[p];
      picture_num();
   }
}
function firstImage() {
   if (loaded == filesize) {
      picture._alpha = 0;
      cargarImg(image[0]);
      desc_txt.text = description[0];
      picture_num();
      slideshow();
   }
}
function picture_num() {
   current_pos = p+1;
   pos_txt.text = current_pos+" / "+total;
}
function slideshow() {
   myInterval = setInterval(pause_slideshow, delay);
   function pause_slideshow() {
      clearInterval(myInterval);
      if (p == (total-1)) {
         p = 0;
         firstImage();
      } else {
         nextImage();
      }
   }
}
function cargarImg(img) {
   var container:MovieClip;
   var mclListener:Object = new Object();
   var mcLoader:MovieClipLoader = new MovieClipLoader();
   mcLoader.addListener(mclListener);
   mcLoader.loadClip(img, picture);
   mclListener.onLoadComplete = function(target:MovieClip) {
      picture.onPress = function() {
                      getURL(arrURL[p],"_BLANK")
      };
   };
}


Comparalo con tu codigo y revisa y estudia los cambios, en resumen, solo carge la imagen con un MoveClipLoader y revisa que, cuando la carga es completa, activa la accion para el link.
P.D. Tienes un <PIC> de sobra al final del XML

Por chko

109 de clabLevel



 

México

firefox
Citar            
MensajeEscrito el 17 Ago 2007 04:31 pm
hola MP solamente para darte las gracias ya resolvi con tu ayuda el problema me salvas te como se dice gracias y te estare molestando cualquier otra duada saludos y suerte

joselo.




chko escribió:

Código :

delay = 4000;
var arrURL:Array = new Array();
//-----------------------
function loadXML(loaded) {
   if (loaded) {
      xmlNode = this.firstChild;
      image = [];
      description = [];
      total = xmlNode.childNodes.length;
      for (i=0; i<total; i++) {
         image[i] = xmlNode.childNodes[i].childNodes[0].attributes.id;
         description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
         arrURL[i] = xmlNode.childNodes[i].childNodes[0].attributes.url;
      }
      firstImage();
   } else {
      content = "file not loaded!";
   }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
   if (Key.getCode() == Key.LEFT) {
      prevImage();
   } else if (Key.getCode() == Key.RIGHT) {
      nextImage();
   }
};
Key.addListener(listen);
previous_btn.onRelease = function() {
   prevImage();
};
next_btn.onRelease = function() {
   nextImage();
};
/////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
   if (Key.getCode() == Key.LEFT) {
      prevImage();
   } else if (Key.getCode() == Key.RIGHT) {
      nextImage();
   }
};
p = 0;
this.onEnterFrame = function() {
   filesize = picture.getBytesTotal();
   loaded = picture.getBytesLoaded();
   preloader._visible = true;
   if (loaded != filesize) {
      preloader.preload_bar._xscale = 100*loaded/filesize;
   } else {
      preloader._visible = false;
      if (picture._alpha<100) {
         picture._alpha += 10;
      }
   }
};
////////////////////////
////////////////
function nextImage() {
   if (p<(total-1)) {
      p++;
      if (loaded == filesize) {
         picture._alpha = 0;
         cargarImg(image[p]);
         desc_txt.text = description[p];
         picture_num();
         slideshow();
      }
   }
}
function prevImage() {
   if (p>0) {
      p--;
      picture._alpha = 0;
      cargarImg(image[p]);
      desc_txt.text = description[p];
      picture_num();
   }
}
function firstImage() {
   if (loaded == filesize) {
      picture._alpha = 0;
      cargarImg(image[0]);
      desc_txt.text = description[0];
      picture_num();
      slideshow();
   }
}
function picture_num() {
   current_pos = p+1;
   pos_txt.text = current_pos+" / "+total;
}
function slideshow() {
   myInterval = setInterval(pause_slideshow, delay);
   function pause_slideshow() {
      clearInterval(myInterval);
      if (p == (total-1)) {
         p = 0;
         firstImage();
      } else {
         nextImage();
      }
   }
}
function cargarImg(img) {
   var container:MovieClip;
   var mclListener:Object = new Object();
   var mcLoader:MovieClipLoader = new MovieClipLoader();
   mcLoader.addListener(mclListener);
   mcLoader.loadClip(img, picture);
   mclListener.onLoadComplete = function(target:MovieClip) {
      picture.onPress = function() {
                      getURL(arrURL[p],"_BLANK")
      };
   };
}


Comparalo con tu codigo y revisa y estudia los cambios, en resumen, solo carge la imagen con un MoveClipLoader y revisa que, cuando la carga es completa, activa la accion para el link.
P.D. Tienes un <PIC> de sobra al final del XML

Por joselo

10 de clabLevel



Genero:Masculino  

msie
Citar            
MensajeEscrito el 21 Ago 2007 09:29 pm
:oops:

hola Mp me ayudaste con esa galeria y gracias todo funciona perfectamente bien pero siempre hay y un pero lo he probado localmemente en mi pc en el servidor de prueba y funciona bien el problema es cuando lo subo a una servidor digamos real la galeria se ve mal o sea las iamgenes no pasan correctamente se eloquece el contador que tiene y se queda trabado por la imagen 9 y de hai no avanza por que es por el servidor el peso de las imagenes por que puede ser por que no encuantro la respuesta gracias.

saludos.

Por joselo

10 de clabLevel



Genero:Masculino  

msie
Citar            
MensajeEscrito el 21 Ago 2007 09:44 pm
1 - asegurate de subir el swf y el xml,
2 - que esten en el mismo nivel tanto las fotos, swf y xml
3 - ¿ cuanto pensan las imagenes ?

PD . Que significa MP

Por chko

109 de clabLevel



 

México

firefox
Citar            
MensajeEscrito el 31 Ago 2007 03:23 pm
bueno mp ya he probado todo va bien en concreto lo que quier ohacer con esa gakeria es algo como esto te paso el link para que veas no se si con esos codigos y ese xml podemos lograr esto o en todo cas oque modificaciones hariamos al mismo codigo que ya tenmos para que funcione el problema que tengo es que los botones que implemete y como puedes ver estan el codigo no me respetan el cambio de imagenes se adelantan muy rapido como se descontrolan y tambien quiero implementar un boton de pausa que detenga y luego reanude la animacion este link lo he visto en otro post de cristallab a una misma persona pidienado lo mismo peor le envian ejemplos parecidos pero no puedo resolverlo todavia en mi caso lo que no puedo hacer es que los botnes me respeten la secuancia de iamagenes como te digo y implementar el boton de pause y que luego reanude com te pregunto com podemos resolver eso usanya este codigo que ya tenemos bueno te paso el link paraque veas y gracias de antemano por las respuestas .

http://www.metoperafamily.org/metopera/

Por joselo

10 de clabLevel



Genero:Masculino  

msie

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.