Comunidad de diseño web y desarrollo en internet online

problema con actionscript

Citar            
MensajeEscrito el 06 Oct 2008 10:58 am
Hola me llamo Jaime y esta es mi primera consulta en el foro.

Tengo un problema con una web que tengo que actualizar y yo no la hice.

http://www.ec-comunicaciones.com/mios/rinair/index.html

si pasáis el ratón por encima de imagenes (abajo) aparece un surtido de fotos en el que si pincháis siempre sale la misma...

y no sé por qué.

Os cuelgo la parte del codigo que creo que falla:

crea_menu();
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_4 RINAIR.jpg', big:'img/FOTO_4 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();
}
};

os estoy muy agradecido

Por chau

3 de clabLevel



 

firefox
Citar            
MensajeEscrito el 06 Oct 2008 11:49 am
Uff, primero que nada, dale formato a tu código

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 06 Oct 2008 01:09 pm
ostras!!! perdona!!!

Código :


stop();
//Importamos la clases
import mx.transitions.Tween;
import mx.transitions.easing.*;
//----- Creación menu -----//
menu = new Array();
menu[0] = {titulo:"Descripción",pelicula:"descripcion"};
menu[1] = {titulo:"Indicaciones",pelicula:"indicaciones"};
menu[2] = {titulo:"Consejos Prácticos",pelicula:"consejos"};
menu[3] = {titulo:"Contacto",pelicula:"contacto"};

var num = 0;
var num_ant = -1;
var estado = 'seguimos';

// CARGAMOS ESTILO PARA LA CAJA DE TEXTO
//Creo un objeto de tipo Hoja de Estilo
var miEstilo:TextField.StyleSheet = new TextField.StyleSheet();
//Cargo dentro de el, el archivo CSS externo
miEstilo.load('estilo.css');
   
function carga_texto(nam){
   menu_item=eval('item'+nam);
   //--------------- Creamos caja de texto------------------//
   menu_item.createTextField("t",this.getNextHighestDepth(),0,0,200,30);
   menu_item.t.type = "dynamic";
   menu_item.t.border = false;
   menu_item.t.background = false;
   menu_item.t.password = false;
   menu_item.t.multiline = false;
   menu_item.t.html = true;
   menu_item.t.embedFonts = false;
   menu_item.t.selectable = false;
   menu_item.t.wordWrap = false;
   //------------ Formateamos el texto -------------------//
      var my_fmt:TextFormat = new TextFormat();
      my_fmt.color = 0xFFFFFF;
      my_fmt.bold = false;
      my_fmt.font = "Myriad Pro"
      my_fmt.size = 20;
      my_fmt.underline = false;
   
   menu_item.t.text=menu_item.titulo;
   menu_item.t.setTextFormat(my_fmt);
}

function restaura_menu(){
   for (i=0;i<menu.length;i++){
      menu_item = eval('item'+i);
      menu_item.enabled = true;
      menu_item.useHandCursor = true;
      var my_fmt:TextFormat = new TextFormat();
      my_fmt.color = 0xFFFFFF;
      my_fmt.bold = false;
      menu_item.t.setTextFormat(my_fmt);
      if (menu_item.activo=='true'){
         var transparencia:Tween = new Tween(menu_item, "_alpha", Regular.easeInOut, 90, 60, 0.5, true);
      }
      menu_item.activo = 'false';
   }
}
//Colocamos ilustracion deportiva
ilustracion = new Array();
ilustracion[0]='baloncesto';
ilustracion[1]='aerobic';
ilustracion[2]='atletismo';
ilustracion[3]='ciclismo';
ilustracion[4]='futbol';

var motivo_dep ='';
function texto_content(str,str2){
   content_holder.tdos._x = 20;
   content_holder.tdos._y = 20;
   var my_fmt:TextFormat = new TextFormat();
   my_fmt.color = 0x003b69;
   my_fmt.bold = true;
   my_fmt.font = "Myriad Pro"
   my_fmt.size = 24;
   my_fmt.underline = false;
   content_holder.tdos.text = str;
   content_holder.tdos.setTextFormat(my_fmt);
   // CAJA DE TEXTO PRINCIPAL
   content_holder.tres._x = 20;
   content_holder.tres._y = 50;
   content_holder.tres.html = true;
   content_holder.tres.multiline = true;
   content_holder.tres.autoSize = true;
   content_holder.tres.selectable = false;
   content_holder.tres.wordWrap = true;
   //Le asignamos el estilo al campo de texto
   content_holder.tres.styleSheet = miEstilo;
   //CARGAMOS TEXTO
   var lv:LoadVars = new LoadVars();
   lv.onLoad = function(exito) {
      if (exito) {
         var content_str:String = new String();
         content_str = unescape(lv.toString());
         content_holder.tres.htmlText = content_str.substr(0, content_str.length-24);
         //Le asignamos el estilo al campo de texto
         content_holder.tres.styleSheet = miEstilo;
      } else {
         content_holder.tres.htmlText = "Error !!!";
         //Le asignamos el estilo al campo de texto
         content_holder.tres.styleSheet = miEstilo;
      }
   };
   lv.load('txt/'+str2+'.txt');
   // CREAMOS SCROLL
   //-------------------------------------------------------------------------------
   //creamos clips para el scroll solo la primera vez
   if (num==0){
      var mascara2:MovieClip = this.createEmptyMovieClip('content_mascara', this.getNextHighestDepth());
      mascara2._x = content_holder._x+20;
      mascara2._y = content_holder._y+50;
      mascara2.beginFill(0x000088);
      mascara2.lineTo(0, 0);
      mascara2.lineTo(505, 0);
      mascara2.lineTo(505, 430);
      mascara2.lineTo(0, 430);
      mascara2.lineTo(0, 0);
      mascara2.endFill();
      mascara2._height = 430;
      mascara2._alpha = 0;
   
      var dragger:MovieClip = this.createEmptyMovieClip('content_dragger', this.getNextHighestDepth());
      dragger._x = content_holder._x+525;
      dragger._y = content_holder._y+50;
      dragger.beginFill(0x003b69);
      dragger.lineTo(0, 0);
      dragger.lineTo(10, 0);
      dragger.lineTo(10, 100);
      dragger.lineTo(0, 100);
      dragger.lineTo(0, 0);
      dragger.endFill();
      dragger._height = 100;
      dragger._alpha = 60;
   }
   //Ocultamos el dragger cuando no haga falta
   if (content_holder.tres._height>mascara2._height){
      dragger._visible = true;
   } else {
      dragger._visible = false;
   }
   //-------------------------------------------------------------------------------
   //declaramos variables
   var posy:Number = 5;
   //variables q van a limitar el movimiento del drag
   izquierda = dragger._x;
   superior = dragger._y;
   derecha = dragger._x;
   inferior = mascara2._height - (dragger._height/2);
   
   //-------------------------------------------------------------------------------
   //iniciamos el drag
   dragger.onPress = function(){   
      //le asignamos las variables
      startDrag(this,false,izquierda,superior,derecha,inferior);
      
   }
   //terminamos el drag
   dragger.onRelease = dragger.onReleaseOutside = function(){
      stopDrag();
   }
   //cambiamos el alpha al poser el cursor
   dragger.onRollOver = function(){
      this._alpha = 75;
   }
   //y la restauramos al quitarlo
   dragger.onRollOut = dragger.onReleaseOutside = function(){
      this._alpha = 60;
   }
   //-----------------------------------------------------------------------------
   //seteamos la mascara al texto o clip
   content_holder.tres.setMask(content_mascara);
   
   //aca el codigo para el easing
   content_holder.tres.onEnterFrame = function(){
      
      /*esta variable basicamente se fija cuanto del texto ha sido "scroleado"
      a travez de la mascara y limita el movimiento del dragger en relacion a
      esta informacion, de esta manera puedes cambiar el tamaño de tu texto o clip
      y la variable se actualizara a si misma*/
      scrolled = (this._height - (mascara2._height /1.3)) / (mascara2._height - dragger._height);
      
      //nueva posicion en y 
      posy =- dragger._y * scrolled;
      
      //cambia la velocidad de 6 o mayor, para un scrol mas lento; y menor, para uno mas rápido
      this._y -= (this._y - posy) /6;
   }
   //content_holder.loadMovie(str+'.swf');
   if (num==0){
      content_holder.clous._x = 564;
      content_holder.clous._y = 1;
      //
      content_holder.clous.beginFill(0x003b69);
      content_holder.clous.lineTo(0,0);
      content_holder.clous.lineTo(20,0);
      content_holder.clous.lineTo(20,20);
      content_holder.clous.lineTo(0,20);
      content_holder.clous.lineTo(0,0);
      content_holder.clous.endFill();
      content_holder.clous.createTextField('clous_t',this.getNextHighestDepth(),2,0,20,20);
         var my_fmt3:TextFormat = new TextFormat();
         my_fmt3.color = 0xFFFFFF;
         my_fmt3.bold = true;
         my_fmt3.font = "Arial"
         my_fmt3.size = 16;
         my_fmt3.underline = false;
      content_holder.clous.clous_t.text = 'X';
      content_holder.clous.clous_t.setTextFormat(my_fmt3);
   }
   num = num+1;
   content_holder.clous.onRelease=function(){
      content_mascara.removeMovieClip();
      dragger.removeMovieClip();
      content_holder.tdos.text='';
      content_holder.tres.text='';
      content_holder.clous.clous_t.text='';
      var transparencia:Tween = new Tween(content_holder, "_alpha", Regular.easeInOut, 60, 0, 1.5, true);
      var transparencia:Tween = new Tween(motivo_dep, "_alpha", Regular.easeInOut, 60, 0, 1.5, true);   
      num = 0;
      restaura_menu();
      transparencia.onMotionFinished = function(){
         content_holder.removeMovieClip();
         motivo_dep.removeMovieClip();
      }
   }
   var num_act = random(5);
   if (num_act==num_ant){
      num_act=num_ant+1;
      if(num_act >= 5) { // Si nos salimos del array
         num_act = 0; // Nos vamos al principio del array
      }
   }
   num_ant=num_act;
   if (str2=='descripcion'){
      var ilus = 'respirad';
      var motivo=this.attachMovie(ilus,ilus,500);
      motivo._x = (800-motivo._width)-20;
      motivo._y = (500-motivo._height)-20;
      motivo._visible = true;
      motivo_dep = motivo;
   } else if (str2=='indicaciones'){
      //no mostramos ilustración pero hacemos desaparecer la que habia
      motivo.removeMovieClip();
   } else if (str2=='consejos'){
      var ilus = 'instruct';
      var motivo=this.attachMovie(ilus,ilus,500);
      motivo._x = (800-motivo._width)-20;
      motivo._y = (500-motivo._height)-1;
      motivo._visible = true;
      motivo_dep = motivo;
   } else {
      var ilus = ilustracion[num_act];
      var motivo=content_holder.attachMovie(ilus,ilus,this.getNextHighestDepth());
      motivo._x = (584-motivo._width)-20;
      motivo._y = (599-motivo._height)-20;
      motivo._visible = true;
      motivo_dep = motivo;
   }
}

function carga_content(str,num,str2){
   if (num==0){
      this.createEmptyMovieClip('content_holder', 10);
      content_holder._x = 215;
      content_holder._y = 0;
      content_holder.beginFill(0xFFFFFF);
      content_holder.moveTo(0, 0);
      content_holder.lineTo(584, 0);
      content_holder.lineTo(584, 599);
      content_holder.lineTo(0, 599);
      content_holder.lineTo(0, 0);
      content_holder.endFill();
      content_holder._alpha = 60;
      content_holder.createTextField('tdos',12,0,0,300,90);
      content_holder.createTextField('tres',13,0,0,505,430);
      content_holder.createEmptyMovieClip('clous', 11);
      var transparencia:Tween = new Tween(content_holder, "_alpha", Regular.easeInOut, 0, 60, 1.5, true);
      transparencia.onMotionFinished = function(){
         texto_content(str,str2);
      }
   } else {
      motivo_dep.removeMovieClip();
      texto_content(str,str2);
   }
}

function crea_menu(){
   for (i=0;i<menu.length;i++){
      this.createEmptyMovieClip('item'+i, this.getNextHighestDepth());
      menu_item = eval('item'+i);
      menu_item.beginFill(0xFFFFFF);
      menu_item.moveTo(-10, 0);
      menu_item.lineTo(200, 0);
      menu_item.lineTo(200, 20);
      menu_item.lineTo(190, 30);
      menu_item.lineTo(-10, 30);
      menu_item.lineTo(-10, 0);
      menu_item.endFill();
      menu_item.titulo = menu[i].titulo;
      menu_item.pelicula = menu[i].pelicula;
      menu_item.activo = 'false';
      menu_item._x = 0;
      menu_item._y = 32*i;
      menu_item._alpha = 0;
      var xPosMenu:Tween  = new  Tween(menu_item, "_x", Regular.easeOut, 800, 10, 1, true);
      var transparencia:Tween = new Tween(menu_item, "_alpha", Regular.easeInOut, 0, 60, 1.5, true);
      transparencia.onMotionFinished = function(){
         for (i=0;i<menu.length;i++){
            carga_texto(i);
         }
      }
      menu_item.onRelease = function(){
         carga_content(this.titulo,num,this.pelicula);
         restaura_menu();
         var my_fmt:TextFormat = new TextFormat();
         this.enabled = false;
         this.useHandCursor = false;
         my_fmt.color = 0x475d8f;
         my_fmt.bold = true;
         this.t.setTextFormat(my_fmt);
         this._alpha = 90;
         this.activo = 'true';
      };
      menu_item.onRollOver = function(){
         var transparencia:Tween = new Tween(this, "_alpha", Regular.easeInOut, 60, 90, 0.5, true);
         var my_fmt:TextFormat = new TextFormat();
         my_fmt.color = 0x475d8f;
         my_fmt.bold = true;
         this.t.setTextFormat(my_fmt);
      };
      menu_item.onRollOut = function(){
         var transparencia:Tween = new Tween(this, "_alpha", Regular.easeInOut, 90, 60, 0.5, true);
         var my_fmt:TextFormat = new TextFormat();
         my_fmt.color = 0xFFFFFF;
         my_fmt.bold = false;
         this.t.setTextFormat(my_fmt);
      };
   }
}

//Creamos carrusel de fotos
crea_menu();
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_4 RINAIR.jpg', big:'img/FOTO_4 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();
   }
};


disculpa eh y gracias

Por chau

3 de clabLevel



 

firefox
Citar            
MensajeEscrito el 06 Oct 2008 01:20 pm
Ok, mucho mejor.
500 líneas de código superan mi capacidad de lectura, pero posiblemente alguien con mas paciencia se las lea.

Jorge

Tip: poner solo la parte en que supones que falla aumenta las posibilidades de obtener respuesta

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 06 Oct 2008 01:26 pm

escribió:


gracias

Código :

//Creamos carrusel de fotos
crea_menu();
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_4 RINAIR.jpg', big:'img/FOTO_4 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;
}

Por chau

3 de clabLevel



 

firefox
Citar            
MensajeEscrito el 06 Oct 2008 01:45 pm
si pasáis el ratón por encima de imagenes (abajo) aparece un surtido de fotos en el que si pincháis siempre sale la misma...


Verás que no hay ningún evento de ratón en la porción que posteaste. No está ahí el problema

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 06 Oct 2008 02:01 pm
espero que te sirva y gracias por la paciencia

Código :

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;
   }
}

Por chau

3 de clabLevel



 

firefox
Citar            
MensajeEscrito el 06 Oct 2008 02:09 pm
Prueba

Código ActionScript :

foto_item.grande = fotos[i].big;
      foto_item.onRelease = function(){
         cargar_foto(this.grande);
      };


Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 06 Oct 2008 02:26 pm
Solucionado, muchísimas gracias y disculpa mi torpeza

Por chau

3 de clabLevel



 

firefox

 

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