Comunidad de diseño web y desarrollo en internet online

Galleria XML con thums

Citar            
MensajeEscrito el 05 May 2008 12:36 am
hola bandita...estoy algo desesperado y recurro a sus sabiduria.... estoy creando una galeria de imagenes con XML, dentro de mi XML tengo 20 imagenes y en el codigo de enseguida pude conseguir que me cargara las primera 10 solo ke este menu de thumbs tiene un par de botones de adelante y atras para poder cargar las otras 10 restantes, solo que no puedo hacer que cargue las otras 10 me podrian ayudar con un empujon checando el codigo y orientarme... si no es mucha molestia o si tienen algun tuto para leer se los agradecere....

import mx.transitions.*;

var rut:MovieClip = this;
var dist_X:Number = 52;
var dist_Y:Number = 50;
var myXML:XML = new XML();
var arr_List:Array = new Array();
var max_col:Number = 2;
var max_row:Number = 8;
var maxVisiblePics:Number = 10;
var galleryTsections:Number = 0;
var gallerySection:Number = 1;



/*OBJETO PARA LOS THUMS*/
var Load_Thum:MovieClipLoader = new MovieClipLoader();
var Thum_listener:Object = new Object();
/*OBJETO PARA LOS IMAGENES GRANDES*/
var Gde_Img:MovieClipLoader = new MovieClipLoader();
var Gde_listener:Object = new Object();

/*VARIABLE CONTADOR PARA HACER PROGRESIVA LA CARGA DE C/U DE LAS IMGS*/
var img_Current:Number;


/*LOADERS CON FADE IN PARA LOS THUMS*/
Thum_listener.onLoadStart = function(cargador) {
//trace("comenzo la carga");
};
Thum_listener.onLoadInit = function(cargador) {
//trace(cargador);
cargador._parent._visible = true;
var FadeIn:Tween = new Tween(cargador._parent, "_alpha", Elastic.easeOut, 0, 100, 30, false);
cargar_thum(img_Current++);
};

Load_Thum.addListener(Thum_listener);

/*LOADERS CON FADE IN PARA LAS FOTOS GRANDES*/
Gde_listener.onLoadStart = function(charger) {
//trace("estoy cargando");
};

Gde_listener.onLoadInit = function(charger) {
//trace(charger);
var Fade_Gde:Tween = new Tween(charger, "_alpha", Elastic.easeOut, 0, 100, 30, false);
};
Gde_Img.addListener(Gde_listener);

/*CREAR UN MC PARA IMG GRANDES*/
rut.attachMovie("Mc_btn","cont_gde",rut.getNextHighestDepth(),{_x:220, _y:0});



myXML.ignoreWhite = true;
myXML.onLoad = function(succes:Boolean) {
if (succes) {

arr_List = this.firstChild.childNodes;

/*DECLARAMOS VARIABLE CONTADOR DE COLUMNAS*/
var cont_col:Number = 0;
/*DECLARAMOS VARIABLE CONTADOR DE FILAS*/
var cont_row:Number = 0;

galleryIndex = 0;
gallerySection = 1;
galleryTsections = Math.ceil(arr_List.length/maxVisiblePics);

if (arr_List.length>maxVisiblePics) {
next_mc.enabled = true;
next_mc._alpha = 100;
} else {
next_mc.enabled = false;
next_mc._alpha = 50;
}
prev_mc.enabled = false;
prev_mc._alpha = 50;
Crear_Btn(galleryIndex);
}

function Crear_Btn(index:Number) {

Cont_thums.removeMovieClip();
_root.createEmptyMovieClip('Cont_thums',_root.getNextHighestDepth());

for (var i:Number = index; i<maxVisiblePics*gallerySection; i++) {

Cont_thums.Boton = rut.attachMovie("Mc_btn", "newClip"+i, rut.getNextHighestDepth());
/*DEFINICION DE PROPIEDADES*/
//prodiedad de separacion en X//
Cont_thums.Boton._x = cont_col*dist_X;
Cont_thums.Boton._y = cont_row*dist_Y;

//Hacemos el boton invisible antes de cargar la img
Cont_thums.Boton._visible = false;
/*DECLARAMOS VARIABLE ID DENTRO DE CADA BTN*/
Cont_thums.Boton.iD = i;

/*CREAMOS UN MC DONDE CARGA LA FOTO*/
Cont_thums.Boton.createEmptyMovieClip("carga",2);
//Boton.carga.loadMovie(arr_List[i].attributes.url);

Cont_thums.Boton.onRollOver = function() {
//trace("soy "+this.iD);
Gde_Img.loadClip(arr_List[this.iD].attributes.gde,rut.cont_gde);
};



/*CONDICION PARA CREAR FILAS Y COLUMNAS*/
cont_col++;
if (cont_col>max_col-1) {
cont_col = 0;
cont_row++;
}


}
max_row = cont_row+1;
img_Current = 0;
cargar_thum(img_Current);
}

};
myXML.load("ofna.xml");




// FUNCION DE IR CARGANDO LOS THUMS

function cargar_thum(num_thum:Number) {
Load_Thum.loadClip(arr_List[num_thum].attributes.url,rut["newClip"+num_thum].carga);

}




/// funciones de los botones next y prev

next_mc.onRelease = function():Void {
galleryIndex += maxVisiblePics;
gallerySection++;
if (gallerySection<=galleryTsections) {
createButtons(galleryIndex);
prev_mc._alpha = 100;
prev_mc.enabled = true;
} else {
gallerySection = galleryTsections;
galleryIndex = (gallerySection-1)*maxVisiblePics;
this._alpha = 50;
this.enabled = false;
}
//info_txt.text = "Seccion: "+gallerySection+" de: "+galleryTotalSections+" Index: "+galleryIndex;
};
prev_mc.onRelease = function():Void {
galleryIndex -= maxVisiblePics;
gallerySection--;
if (gallerySection>=1) {
createButtons(galleryIndex);
next_mc._alpha = 100;
next_mc.enabled = true;
} else {
galleryIndex = 0;
gallerySection = 1;
this._alpha = 50;
this.enabled = false;
}
//info_txt.text = "Seccion: "+gallerySection+" de: "+galleryTotalSections+" Index: "+galleryIndex;
};

Por Mike Morales

62 de clabLevel



Genero:Masculino  

msie7
Citar            
MensajeEscrito el 05 May 2008 10:50 am
Uff, si nos explicas como pasas de página y pones solo lo relativo a eso podrás tener mas chance de respuesta

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 05 May 2008 10:17 pm
hola solisarg gracias por tu comentario... el chiste de todo esto es que con este codigo puedo cargar 10 fotos del XML o sea del 0 al 9 esto lo delimito con la variable var maxVisiblePics:Numberl = 10; le digo que solo muestre 10 pero necesito que al darle al boton de next me cargue del 10 al 19 o sea el resto del XML, :S

Por Mike Morales

62 de clabLevel



Genero:Masculino  

msie7
Citar            
MensajeEscrito el 06 May 2008 01:13 am
Ese rango se controla con un for en el primer parametro del for( 1 parametro;2 parametro;++) pones el valor por ejemplo 0 en el segundo 10 ,en el tercero el ++ , despues, cada que des un click aumentas 10 el primer y el segundo parametro osea cuando des click ya tendras de 10 hasta 20 si das otravez click tendras 20 hasta 30 etc etc.. como conclusion usa el for.

Por DiegoAzul

376 de clabLevel



 

Mx

firefox
Citar            
MensajeEscrito el 06 May 2008 06:00 pm
Diego Azul, muchas graciaspor el aporte lo voy a intentar...

Por Mike Morales

62 de clabLevel



Genero:Masculino  

msie7
Citar            
MensajeEscrito el 06 May 2008 07:51 pm
que tal diego fijate que el detalles que no esta entrando lafuncion con elparametro es lo que no entiendo ke pasara al darle next

Por Mike Morales

62 de clabLevel



Genero:Masculino  

msie7

 

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