Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/06/2011, 21:14
Lola Lola
 
Fecha de Ingreso: agosto-2007
Mensajes: 122
Antigüedad: 16 años, 8 meses
Puntos: 3
cOMO ACELERAR GALERIA FLASH LENTISIMA???

HOLA AMIGOS!

He realizado varias galerias flash en el sitio www.yoteinvito.net. Las imágenes pesan entre 50 y 70 kb, muy razonables para un sitio web, la compresión es buena como para mostrar las imagenes a buena velocidad en conexion banda ancha.

SIN EMBARGO la galeria demora siiiiiiiiiiiiglos en mostrar cada imagen!! esto es muy perjudicial para cualquier sitio, les pido por favor me ayuden a entender que puede estar sucediendo.

Si bien no domino flash ni por asomo, algunas cosillas veo como van. La galeria funciona leyendo las fotos de un fichero, y las instrucciones de la capa acciones indican:


*/
// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. "pics/")
// leave it blank if they're in the same directory
this.pathToPics = "fts_casamiento_el+ella/";
// fill this array with your pics
this.pArray = ["01.jpg", "02.jpg", "03.jpg", "04.jpg", "05.jpg", "06.jpg", "07.jpg", "08.jpg", "09.jpg", "10.jpg"];
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
// Actions -----------------------------------------
// these aren't necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);


La galería corre bien pero muy leeeeeeeeeeeeeeeentoooo... Una vez que se cargan las imagenes ya funciona mejor pero, es necesario que demore tanto inicialmente, cansado al visitante??? Hay alguna manera de mejorar el rendimiento???

Muchas gracias y saludos!!!!!!

Lola Lola