Foros del Web » Creando para Internet » Flash y Actionscript »

problema con preload de galeria xml

Estas en el tema de problema con preload de galeria xml en el foro de Flash y Actionscript en Foros del Web. Hola a todos, Soy de Italia, y es la primera ves que escribo en ese foro, espero ,e puedan ayudar... Estoy trabajando sobre una galeria ...
  #1 (permalink)  
Antiguo 23/02/2007, 07:33
 
Fecha de Ingreso: febrero-2007
Mensajes: 1
Antigüedad: 17 años, 2 meses
Puntos: 0
problema con preload de galeria xml

Hola a todos,
Soy de Italia, y es la primera ves que escribo en ese foro, espero ,e puedan ayudar...

Estoy trabajando sobre una galeria de imagenes.
Todo funciona bien pero no logro poner un preload al imajen que llega a ser visible cuando cliqueo los botones de la thumbs.

Espero me puedan entender...
Pongo el codigo...

Código:
Stage.scaleMode = "noScale";
Stage.showMenu = false;
Stage.align = "TL";
var miXML = new XML();
miXML.ignoreWhite = true;
miXML.load("imagenes.xml");
_global.anterior = "";
x = 10;
y = 10;
ancho = 65;
alto = 80;
// -- numero di colonne
num_columnas = 4;

creaGaleria = function (Void) {
	 xposMouse = _root._xmouse;
     velMax = 6;
	 velMin = 0;
	 mitad = 300;
	 anchoEscena = 600;
	 anchoMC = 120;
	
	createEmptyMovieClip("galeria", 2);
	galeria.x = 30;
	galeria._y = 10;

for (var i = 0; i<=miXML.firstChild.childNodes.length-1; i++) {
		galeria.createEmptyMovieClip("foto"+i, i+10);
		galeria["foto"+i].createEmptyMovieClip("conFoto", 0);
		galeria["foto"+i].attachMovie("preload","preload", 1); 
		
		galeria["foto"+i].id = miXML.firstChild.childNodes[i].attributes.id;
		galeria["foto"+i].grande = miXML.firstChild.childNodes[i].attributes.grande;
		galeria["foto"+i].conFoto.loadMovie(miXML.firstChild.childNodes[i].attributes.id);
		galeria["foto"+i].onEnterFrame = function(Void) {
			var cargado = this.conFoto.getBytesLoaded();
			var total = this.conFoto.getBytesTotal();
			if (cargado == total && total>50) {
				//dimenzione thumbn//
				this._width = 60;
				this._height = 45;
				delete this.onEnterFrame;
				this.preload.removeMovieClip();
			} else {
				//istruzione di caricamento nn va
				var porcent = Math.round((cargado*100)/total);
				this.preload.barra._xscale = porcent;
			}
		};
		galeria["foto"+i]._x = x; 
		galeria["foto"+i]._y = y;
	 

		x += ancho; 
		columna += 1;
						if (columna == num_columnas) {
				columna = 0;
				x -= (ancho*num_columnas);
				y += alto;
			}
		//galeria["foto"+i]._x = i*55;
		galeria["foto"+i].onRelease = function(Void) {
			this._parent._parent.createEmptyMovieClip("mostrar", 1);
			this._parent._parent.mostrar.id = this.id;
			this._parent._parent.mostrar.grande = this.grande;
						this._parent._parent.mostrar.createEmptyMovieClip("src", 2);
			this._parent._parent.mostrar.src.loadMovie(this.grande);
			//posizione visualizzazione grande
			this._parent._parent.mostrar._x = 460;
			this._parent._parent.mostrar._y = 30;
			//caricamento dell'immagine grande
			
			
			
/////////////////////// EL PROBLEMA ESTà AQUI  ////////////////////////////////			
			
			
			function check_loaded() {
	this.loader._x = int(Stage.width/2)-16;
	this.loader._y = int(Stage.height/2)-16;
	this.loader._alpha = 40;
	if (this._parent._parent.mostrar.getBytesLoaded()>=this._parent._parent.mostrar.getBytesTotal() and this._parent._parent.mostrar.getBytesTotal()>0) {
		this.loader._alpha = 0;
		clearInterval(check_load_int);
		fade_in_loader();
	}
}
check_load_int = setInterval(check_loaded, 50);



//////////////////////////////////////////////////////////////

			
			
			//link dell'immagine caricata
			this._parent._parent.mostrar.onRelease = function(Void) {
				getURL("");
			};
			anterior.enabled = true;
			anterior._alpha = 100;
			this.enabled = false;
			this._alpha = 50;
			anterior = this;
		};
	}
	delete this;
};
miXML.onLoad = creaGaleria;
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:28.