Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/04/2008, 09:26
exneta
 
Fecha de Ingreso: abril-2008
Mensajes: 1
Antigüedad: 16 años
Puntos: 0
cuando hay conexion lenta no carga la imagen externa

La amimacion lleva un cargador, un intro con sonido y al final de la animacion debe quedar una fotografia que va cambiando cada 16 segundos.

La fotografia va apareciendo con un efecto alpha y desaparece de la misma manera, la otra fotografia entra de igual manera al ir saliendo la fotografia anterior, para que las fotografias se puedan estar cambiando las tomo de una carpeta externa.

Todo funciona bien, el problema es que no carga la fotografia del final cuando hay una conexion lenta o algun tipo de perdida momentanea con el internet.

Esto pasaba en algunos casos y con el simulador de descarga comprobe lo anterior

E pensado como se podria solucionar no se si haya una forma cargar imagenes en el cache, e intentado llamarla desde el principio pero sige igual.

¿ALGUNA IDEA?

GRACIAS DE ANTEMANO

Les dejo el codigo por si de algo les sirve

loadVariablesNum("datos.txt",0);
var miLV = new LoadVars();
var ElBoton1 = new text;
var ElBoton2 = new text;
var ElBoton3 = new text;
var ElBoton4 = new text;
miLV.onLoad = function(exito:Boolean) {
if (exito) {
ElBoton1 = miLV.btn_1;
ElBoton2 = miLV.btn_2;
ElBoton3 = miLV.btn_3;
ElBoton4 = miLV.btn_4;
} else {
informacion.text = "ERROR AL CARGAR!!!";
}
};

alfamas = function (clip, clip2) {

this.createEmptyMovieClip("loop", 3);
loop.onEnterFrame = function() {
clip._alpha += 7;
clip2._alpha -= 7;
if (clip._alpha>=100 or clip._alpha <= 0) {
delete loop.onEnterFrame;
clip2._alpha = 0;
}
};
};

function IncrementaX() {
if(x<2){
x = x + 1;
}else{
x = 1;
}
}
IncrementaX();
if (this.carga_img._alpha == 0){
this.carga_img.loadMovie ("imgdata/img00"+String(x)+".jpg");
this.carga_img._alpha = 0;
}else{
this.carga_img2.loadMovie("imgdata/img00"+String(x)+".jpg");
this.carga_img2._alpha = 0;
}

//this.createTextField("porcentaje", 2, 10, 10, 200, 16);
//this.carga_img._x = 6;
//this.carga_img._y = 83;
//this.ancho = 200;
//this.alto = 200;

this.onEnterFrame = function() {
miLV.load("datos.txt");
if (this.carga_img._alpha == 0){
this.carga_img.percent = (this.carga_img.getBytesLoaded()/this.carga_img.getBytesTotal())*100;
if (!isNan(this.carga_img.percent)) {
this.porcentaje.text = Math.round(this.carga_img.percent)+" %";
}
if (this.carga_img.percent == 100) {
alfamas(this.carga_img, this.carga_img2);
}
// this.porcentaje.removeTextField();
delete this.onEnterFrame;
}else{
this.carga_img2.percent = (this.carga_img2.getBytesLoaded()/this.carga_img2.getBytesTotal())*100;
if (!isNan(this.carga_img2.percent)) {
this.porcentaje2.text = Math.round(this.carga_img2.percent)+" %";
}

if (this.carga_img2.percent == 100) {
alfamas(this.carga_img2, this.carga_img);
}
this.porcentaje.removeTextField();
delete this.onEnterFrame;
}
};