Comunidad de diseño web y desarrollo en internet online

Limpiar cache en galería de imágenes xml

Citar            
MensajeEscrito el 19 Abr 2011 12:34 pm
Hola a todos.
Esta es mi duda. Tengo un web formada por varios archivos swf. En el index.swf tengo un menú que carga otros swf en un clip llamado contendor_mc.
Estos otros swf son distintas galerías de imágenes que cargan un xml distinto cada una. El código es uno de ellos cualquiera es en el frame 1:

Código :

co=0;
_global.sig = 15;
_global.pag2 = 0;
this._lockroot = true;


y en el frame 2:

Código :

stop();
function iniciar(){
   System.useCodepage = true;
   miXML.unload();
   miXML=new XML();
   miXML.load("furia-de-titanes.xml?NoCache=" + random(9999));
   miXML.onLoad=interprete;
   miXML.ignoreWhite=true;
}

function interprete(){
   texto=new Array();
   texto=miXML;
   generar();
}

inicio=0;
y=90;

function generar(){
   acomentarios=texto.firstChild.childNodes;
   _global.totalc = acomentarios.length;
   trace("totalc es" +totalc);
   final = totalc_visible;
       attachMovie("mcPunto0","punto",this.getNextHighestDepth());
      this["punto"].imagen1 = texto.firstChild.childNodes[0].attributes.imgthumb;      
      this["punto"].imagen2 = texto.firstChild.childNodes[1].attributes.imgthumb;      
      this["punto"].imagen3 = texto.firstChild.childNodes[2].attributes.imgthumb;   
      this["punto"].imagen4 = texto.firstChild.childNodes[3].attributes.imgthumb;      
      this["punto"].imagen5 = texto.firstChild.childNodes[4].attributes.imgthumb;   
      this["punto"].imagen6 = texto.firstChild.childNodes[5].attributes.imgthumb;   
      this["punto"].imagen7 = texto.firstChild.childNodes[6].attributes.imgthumb;   
      this["punto"].imagen8 = texto.firstChild.childNodes[7].attributes.imgthumb;   
      this["punto"].imagen9 = texto.firstChild.childNodes[8].attributes.imgthumb;   
      this["punto"].imagen10 = texto.firstChild.childNodes[9].attributes.imgthumb;   
      this["punto"].imagen11 = texto.firstChild.childNodes[10].attributes.imgthumb;   
      this["punto"].imagen12 = texto.firstChild.childNodes[11].attributes.imgthumb;   
      this["punto"].imagen13 = texto.firstChild.childNodes[12].attributes.imgthumb;   
      this["punto"].imagen14 = texto.firstChild.childNodes[13].attributes.imgthumb;   
      this["punto"].imagen15 = texto.firstChild.childNodes[14].attributes.imgthumb;            
      this["punto"].grande1 = texto.firstChild.childNodes[0].attributes.imagen;      
      this["punto"].grande2 = texto.firstChild.childNodes[1].attributes.imagen;      
      this["punto"].grande3 = texto.firstChild.childNodes[2].attributes.imagen;   
      this["punto"].grande4 = texto.firstChild.childNodes[3].attributes.imagen;      
      this["punto"].grande5 = texto.firstChild.childNodes[4].attributes.imagen;   
      this["punto"].grande6 = texto.firstChild.childNodes[5].attributes.imagen;   
      this["punto"].grande7 = texto.firstChild.childNodes[6].attributes.imagen;   
      this["punto"].grande8 = texto.firstChild.childNodes[7].attributes.imagen;   
      this["punto"].grande9 = texto.firstChild.childNodes[8].attributes.imagen;   
      this["punto"].grande10 = texto.firstChild.childNodes[9].attributes.imagen;   
      this["punto"].grande11 = texto.firstChild.childNodes[10].attributes.imagen;   
      this["punto"].grande12 = texto.firstChild.childNodes[11].attributes.imagen;   
      this["punto"].grande13 = texto.firstChild.childNodes[12].attributes.imagen;   
      this["punto"].grande14 = texto.firstChild.childNodes[13].attributes.imagen;   
      this["punto"].grande15 = texto.firstChild.childNodes[14].attributes.imagen;      
      fotoprov = this["punto"].grande1;
      this["punto"].fotocontenedor.loadMovie(fotoprov);      
      this["punto"].reg = i;
       this["punto"]._x =0;
      this["punto"]._y = y;

      
      if((this["punto"].imagen2)==undefined){
         this["punto"].invis2.enabled = false;
      }
      if((this["punto"].imagen3)==undefined){
         this["punto"].invis3.enabled = false;      
      }
      if((this["punto"].imagen4)==undefined){
         this["punto"].invis4.enabled = false;
      }
      if((this["punto"].imagen5)==undefined){
         this["punto"].invis5.enabled = false;
      }
      if((this["punto"].imagen6)==undefined){
         this["punto"].invis6.enabled = false;
      }
      if((this["punto"].imagen7)==undefined){
         this["punto"].invis7.enabled = false;
      }      
      
      if((this["punto"].imagen8)==undefined){
         this["punto"].invis8.enabled = false;
      }
      if((this["punto"].imagen9)==undefined){
         this["punto"].invis9.enabled = false;
      }
      if((this["punto"].imagen10)==undefined){
         this["punto"].invis10.enabled = false;
      }
      if((this["punto"].imagen11)==undefined){
         this["punto"].invis11.enabled = false;
      }
      if((this["punto"].imagen12)==undefined){
         this["punto"].invis12.enabled = false;
      }
      if((this["punto"].imagen13)==undefined){
         this["punto"].invis13.enabled = false;
      }
      if((this["punto"].imagen14)==undefined){
         this["punto"].invis14.enabled = false;
      }
      if((this["punto"].imagen15)==undefined){
         this["punto"].invis15.enabled = false;
      }   
      
      scroll_izda._visible = false;
   if(sig >= totalc){
      scroll_dcha._visible = false;
   }else{
      scroll_dcha._visible = true;
      scroll_dcha._y = 523,30;      
   }

}
iniciar();

stop();


Bueno, las galerías funcionan perfectamente, cargan las imágenes, los thumbs y las grandes, sin problemas, y cuando cambio de una galería a otra me carga el xml nuevo, con las fotos nuevas, todo bien.
Lo curioso es que tanto en firefox como en chrome, si por ejemplo estoy en una galería que tiene sólo 3 fotos, y voy a otra que tiene 15, carga los 15 thumbs perfectamente, se ven todos, pero al instante, el thumb 4, 5, 6 y 7 (por ejemplo) desaparecen. Es decir, algunos de los que irían detrás de la última foto en la galería anterior... (no sé si me estoy explicando).
En IE no ocurre.
¿A alguien se le ocurre por qué está ocurriendo esto?
Muchas gracias

Por ladyevil

14 de clabLevel



 

firefox
Citar            
MensajeEscrito el 19 Abr 2011 02:33 pm
La galería que usas no es dinámica en absoluto, tal como lo tienes si pongo 16 fotos no me mostraría la última, deberías usar loops para crear todo en base al largo del array de fotos. Pero mas importante aún, no tiene un destroy o clean, es decir deberías cargarte mcPunto0 cada vez que te mueves.

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 20 Abr 2011 07:47 am
Hola Jorge, muchas gracias por tu respuesta.
En mi cuestión no puse todos los códigos del flash ;), tengo un botón de "siguiente" y un "anterior" que va recargando los valores de 'this["punto"].imagen1' y 'this["punto"].grande1' con los siguientes elementos del xml, del 16 en adelante... Todo esto funciona bien, me muestra todas las imágenes sin problemas.
Pero esto no tiene nada que ver con lo que preguntaba, ¿no?. Por favor, a ver si a alguien se le ocurre como puedo arreglar el tema de la caché de imágenes en firefox y chrome.
Muchas gracias de nuevo.

Por ladyevil

14 de clabLevel



 

firefox
Citar            
MensajeEscrito el 20 Abr 2011 09:25 am
Bueno, por si a alguien le pasa algún día algo parecido... acabo de encontrar la solución en Google aunque aún lo entiendo muy bien...
Resulta que funciona perfectamente cuando publicas la película en Flash 6 ó 7 :roll:
En fin.
Espero que a alguien le sirva de ayuda

Por ladyevil

14 de clabLevel



 

firefox

 

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