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

Carrusel de Imágenes en ActionScript

Estas en el tema de Carrusel de Imágenes en ActionScript en el foro de Flash y Actionscript en Foros del Web. Hola chicos, Soy nuevo aquí y os pido ayuda para un problema que tengo con una web del curro. Resulta que un ex-compañero nos dejó ...
  #1 (permalink)  
Antiguo 06/08/2008, 01:42
 
Fecha de Ingreso: agosto-2008
Mensajes: 1
Antigüedad: 15 años, 8 meses
Puntos: 0
Carrusel de Imágenes en ActionScript

Hola chicos,

Soy nuevo aquí y os pido ayuda para un problema que tengo con una web del curro. Resulta que un ex-compañero nos dejó un "carrusel de imágenes" preparado con 2 imágenes (miniatura y tamaño real) para intercambiarlas por las imágenes correctas. Pero, resulta que al cambiar el código, las miniaturas sí me las coloca bien pero cuando pinchamos en cada una de ellas, siempre nos hace referencia a la última de la lista. Os pego el código para ver qué puede estar mal.

Gracias y espero que me ayudéis lo antes posible.

CÓDIGO:



//Creamos carrusel de fotos
fotos = new Array();
fotos[0] = {mini:'img/FOTO_1 RINAIR.jpg', big:'img/FOTO_1 RINAIR_G.jpg'};
fotos[1] = {mini:'img/FOTO_2 RINAIR.jpg', big:'img/FOTO_2 RINAIR_G.jpg'};
fotos[2] = {mini:'img/FOTO_3 RINAIR.jpg', big:'img/FOTO_3 RINAIR_G.jpg'};
fotos[3] = {mini:'img/FOTO_4 RINAIR.jpg', big:'img/FOTO_4 RINAIR_G.jpg'};
fotos[4] = {mini:'img/FOTO_5 RINAIR.jpg', big:'img/FOTO_5 RINAIR_G.jpg'};
fotos[5] = {mini:'img/FOTO_6 RINAIR.jpg', big:'img/FOTO_6 RINAIR_G.jpg'};
fotos[6] = {mini:'img/FOTO_7 RINAIR.jpg', big:'img/FOTO_7 RINAIR_G.jpg'};
fotos[7] = {mini:'img/FOTO_8 RINAIR.jpg', big:'img/FOTO_8 RINAIR_G.jpg'};
var separacion:Number = 5;
var ancho_mini:Number = 90;
for (i=0;i<fotos.length;i++){
this.createEmptyMovieClip('imagen'+i, 670+i);
foto_item = eval('imagen'+i);
foto_item.beginFill(0xFF0000);
foto_item.lineTo(0,0);
foto_item.lineTo(90,0);
foto_item.lineTo(90,90);
foto_item.lineTo(0,90);
foto_item.lineTo(0,0);
foto_item.endFill();
foto_item._x = (100*i)+separacion;
foto_item._y = 500+separacion;
foto_item.loadMovie(fotos[i].mini);
foto_item._visible = false;
foto_item._alpha = 0;
}
function crea_carrusel(stre){
for (i=0;i<fotos.length;i++){
foto_item = eval('imagen'+i);
foto_item._visible = true;
var transparencia:Tween = new Tween(foto_item, "_alpha", Regular.easeInOut, 0, 100, 1.5, true);
foto_item.grande = fotos[i].big;
foto_item.onRelease = function(){
cargar_foto(foto_item.grande);
};
}
btn_replegar();
}
function elimina_carrusel(){
bt_replegar.removeMovieClip();
for (i=0;i<fotos.length;i++){
foto_item = eval('imagen'+i);
var transparencia:Tween = new Tween(foto_item, "_alpha", Regular.easeInOut, 100, 0, 0.2, true);
foto_item._visible = false;
}
}
function btn_replegar(){
this.createEmptyMovieClip('bt_replegar', 700);
bt_replegar._x = 0;
bt_replegar._y = 0;
bt_replegar.beginFill(0x000088);
bt_replegar.lineTo(0, 0);
bt_replegar.lineTo(799, 0);
bt_replegar.lineTo(799, 500);
bt_replegar.lineTo(0, 500);
bt_replegar.lineTo(0, 0);
bt_replegar.endFill();
bt_replegar._alpha=0;
bt_replegar.useHandCursor = false;
bt_replegar.onRollOver = function(){
replegar();
}

};
function desplegar(){
fotos_area.fotos_t1._visible = false;
fotos_mascara.useHandCursor = false;
fotos_mascara.enabled = false;
var yPosMarc:Tween = new Tween(fotos_holder, "_y", Regular.easeOut, 590, 500, 1, true);
yPosMarc.onMotionFinished = function(){
crea_carrusel();
}
}
function replegar(){
elimina_carrusel();
var yPosMarc2:Tween = new Tween(fotos_holder, "_y", Regular.easeOut, 500, 590, 1.5, true);
yPosMarc2.onMotionFinished = function(){
fotos_area.fotos_t1._visible = true;
fotos_mascara.useHandCursor = true;
fotos_mascara.enabled = true;
}
}
this.createEmptyMovieClip('fotos_holder', 666);
fotos_holder._x = 0;
fotos_holder._y = 590;
fotos_holder.beginFill(0x475d8f);
fotos_holder.lineTo(0,0);
fotos_holder.lineTo(799,0);
fotos_holder.lineTo(799,100);
fotos_holder.lineTo(0,100);
fotos_holder.lineTo(0,0);
fotos_holder.endFill();
fotos_holder._alpha = 60;
this.createEmptyMovieClip('fotos_area', 667);
fotos_area._x=0;
fotos_area._y=500;
fotos_area.width=800;
fotos_area.height=100;
fotos_area.beginFill(0xFFFFFF);
fotos_area.lineTo(0,0);
fotos_area.lineTo(800,0);
fotos_area.lineTo(800,100);
fotos_area.lineTo(0,100);
fotos_area.lineTo(0,0);
fotos_area.endFill();
fotos_area._alpha = 0;
fotos_area.createTextField('fotos_t1', 668,0,0,200,100);
var my_fmtdos:TextFormat = new TextFormat();
my_fmtdos.color = 0x475d8f;
my_fmtdos.bold = true;
my_fmtdos.font = "Myriad Pro"
my_fmtdos.size = 14;
my_fmtdos.underline = false;
fotos_area.fotos_t1._visible = true;
fotos_area.fotos_t1._y = 70;
fotos_area.fotos_t1.text = 'Imágenes >>';
fotos_area.fotos_t1.setTextFormat(my_fmtdos);
this.createEmptyMovieClip('fotos_mascara', 669);
fotos_mascara._x = 0;
fotos_mascara._y = 500;
fotos_mascara.beginFill(0x000088);
fotos_mascara.lineTo(0, 0);
fotos_mascara.lineTo(799, 0);
fotos_mascara.lineTo(799, 99);
fotos_mascara.lineTo(0, 99);
fotos_mascara.lineTo(0, 0);
fotos_mascara.endFill();
fotos_mascara.onRollOver = function(){
desplegar();
}
fotos_mascara.onRelease = function(){
menu_item.t.text='mascara pasamos';
};
this.fotos_holder.setMask(this.fotos_mascara);

function cargar_foto(strin){
bt_replegar.removeMovieClip();
this.createEmptyMovieClip('imagen_btn', 9999);
imagen_btn._x = 0;
imagen_btn._y = 0;
imagen_btn.beginFill(0x475d8f);
imagen_btn.lineTo(0, 0);
imagen_btn.lineTo(800, 0);
imagen_btn.lineTo(800, 600);
imagen_btn.lineTo(0, 600);
imagen_btn.lineTo(0, 0);
imagen_btn.endFill();
imagen_btn._alpha = 65;
this.createEmptyMovieClip('imagen_holder', 10000);
imagen_holder._x = 165;
imagen_holder._y = 0;
imagen_holder.width=470;
imagen_holder.height=600;
loadMovie(strin, 'imagen_holder');
imagen_btn.onRelease = function(){
imagen_holder.removeMovieClip();
imagen_btn.removeMovieClip();
btn_replegar();
}
};
  #2 (permalink)  
Antiguo 06/08/2008, 01:50
Avatar de tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 7 meses
Puntos: 381
Respuesta: Carrusel de Imágenes en ActionScript

Tema trasladado desde (X)HTML
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 19:13.