Comunidad de diseño web y desarrollo en internet online

Problema con Flash y XML

Citar            
MensajeEscrito el 31 Ene 2008 10:04 am
Hola, Tengo un problema que espero con suerte podáis ayudar a resolver:

Adquirí una galería de imágenes que tira de un XML para cargar los datos. Esta galería, como tantas otras, tiene la cualidad de, pulsando sobre el thumbnail, poder ver la misma imagen en grande. Lo que necesito es saber si puedo modificar el código ActionScript para que al pulsar sobre la miniatura lo que aparezca en pantalla sea un swf cargado dentro del propio swf original, supongo en un MC vacío. Cada imagen, que pueden ser muchas, iría enlazada a su propio swf; lo que imagino obligaría a alterar el XML de esta forma, cambiando <img>foto01.jpg</img> por <img>foto01.swf</img>. He probado de mil maneras, pero no he dado con la solución, seguramente porque soy diseñador por vocación y programador por obligación.

Os facilito parte del AS que creo sería necesario retocar:

Código :

function parseXml() {
   //DEBUG
   //trace(gallery.dump());
   
   myGallery = new Array();
   
   // gallery title
   galleryTitle = gallery.attributes.title;
   title_txt.text = galleryTitle;
   
   // thumbanil directory
   thumbDir = gallery.attributes.thumbDir;
   // image directory
   imageDir = gallery.attributes.imageDir;       <--------------- CREO QUE ES AQUI
   // random ? true : false
   viewRandom = gallery.attributes.random;
   if(viewRandom == "true") {
      viewRand = true;
   } else {
      viewRand = false;
   }
   // parse information
   catTotal = gallery.category.length;

   for(var i=0; i<catTotal; i++) { //looping through categories
      myGallery[i] = new Array();
      myGallery[i]["name"] = gallery.category[i].attributes.name;
      myGallery[i]["image"] = new Array();
      //trace(myGallery[i]["name"]);
      var imageCount = gallery.category[i].image.length;
      for(var k=0; k<imageCount; k++) { //looping through images
         myGallery[i]["image"][k] = new Array();
         myGallery[i]["image"][k]["date"] = gallery.category[i].image[k].date.getValue();
         myGallery[i]["image"][k]["title"] = gallery.category[i].image[k].title.getValue();
         myGallery[i]["image"][k]["desc"] = gallery.category[i].image[k].desc.getValue();
         myGallery[i]["image"][k]["thumb"] = gallery.category[i].image[k].thumb.getValue();
         myGallery[i]["image"][k]["img"] = gallery.category[i].image[k].img.getValue(); <–––––––– Y AQUI


¿Alguna sugerencia? Puedo facilitaros el código que me pidais. Gracias mil ;)

Por flasheado

7 de clabLevel



Genero:Masculino  

safari
Citar            
MensajeEscrito el 04 Feb 2008 10:55 pm
Hola de nuevo. Continuo buscando soluciones a mi problema.

He aplicado sobre un MC vacío (llamado "empty_mc") esto:

Código :

on(release){ 
     loadMovieNum(myGallery[index]["img"],1) 
     trace(myGallery[index]["img"]) 
}

Siendo "img" el nodo preciso del XML para que Flash localice el swf. Pero la cosa no funciona. :cry: ¿Hay algún amigo que me pueda ayudar?[/code]

Por flasheado

7 de clabLevel



Genero:Masculino  

safari

 

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