Comunidad de diseño web y desarrollo en internet online

GALERIA XML

Citar            
MensajeEscrito el 28 Abr 2008 07:13 pm
HOLA. TENGO UNA GALERIA EN XML QUE FUNCIONA.
AHORA... MI PROBLEMA ES EL SIGUEINTE:

QUIERO QUE SIN IMPORTAR EL TAMAÑO DE LAS IMAGENES Q CARGUE ESTAS QUEDEN CENTRADAS.
DEBERÍA PRIMERO QUE NADA AVERIGUAR EL TAMAÑO DE LA FOTO PARA DESPUES SITUARLA EN EL STAGE.

LES DEJO MI CODIGO Y MUCHAS GRACIAS POR LA AYUDA

Código :

///////////////////////////////////////
//////////////////////////////////////
//lapelicula esta a 24fps para que el efecto over de los botones sea mas suave y quede mejor
var prof:Number = 0;

createEmptyMovieClip(\"galeria\",prof++);
galeria._x = 0;
galeria._y = 0;
///////////////////////////////////////
//////////////////////////////////////
function carga_XML() {
   menu = new XML();
   //define un objeto del tipo XML.
   menu.load(\"galeria_grafica.xml\");
   //si esta dentro de la misma carpeta lo dejo asi, sino le pongo la ruta completa.
   menu.onLoad = interprete;
   menu.ignoreWhite = true;
}
function interprete() {
   menuArray = menu.firstChild.childNodes;
   var y:Number = 480;
   //coordenadas y para botones
   var x:Number = 5;
   // coordenadas x para botones
   var i:Number = 0;
   //indice = for 
   for (i=0; i<menuArray.length; i++) {
      galeria.attachMovie(\"marco\",\"marco\"+i,prof++,{_x:x, _y:y, grande:menuArray[i].attributes.archivogrande});
      //y += 50; // distancia entre thumbs
      x += 70;
      if (x>70*10) {
         y = 400;
         x = 5;
      }
      // galeria horizontal    
      //distancia entre botones
      //y = +10;
      //alto del clip
      loadMovie(\"foto_chica_grafica/\"+menuArray[i].attributes.archivo, galeria[\"marco\"+i].contenedor);
   }
}
//////////////////////////////////////
//////////////////////////////////////
carga_XML();
createEmptyMovieClip(\"fgrande\",prof++);
fgrande._x = 0;
fgrande._y = 0;
///////////////////////////////////////
//////////////////////////////////////

Por mnico

18 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 28 Abr 2008 10:07 pm
Ya lo logré !!! gracias a este tutorial y un poco de cabeza

http://www.cristalab.com/foros/p373417.html#373417


gracias de todos modos,

:.Mauri.

Por mnico

18 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 29 Abr 2008 04:44 pm
AHORA SI ALGUIEN ME AYUDA ME GUSTARIA PODER AGREGARLE TANTO A LA CARGA DE LAS IMAGENES PEQUEÑAS COMO A LAS IMAGENES GRANDE UN PRELOADER DENTRO DE ESE CODIGO.

NO SE SI CON UN LISTENER O ALGO... NO ME DOY CUENTA. YA BASTANTE MAREO ME AGARRÉ PARA Q FUNCIONARA :p

SALUDOS Y GRACIAS,

:.Mauricio.

Por mnico

18 de clabLevel



Genero:Masculino  

firefox

 

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