Comunidad de diseño web y desarrollo en internet online

problema con carga en nivel y setInterval

Citar            
MensajeEscrito el 19 Abr 2010 02:50 pm
Hola tengo un problema que llevo tres días sin encontrar solución espero que me puedan dar una mano:

El problema es el siguiente:

tengo un contenedor que tiene un menu con los siguiente botones(inicio, historia, latienda, galeria, contacto)
el boton inicio carga una swf externo en el nivel 5 llamado inicio.swf

en inicioswf hay un pase de 3 imagenes hecho con setInterval(); que contiene una animación con tween y es un ciclo infinito que se repite. hasta ahi me funciona todo ok.

el problema esta que cuando la sección inicio esta cargada y funcionando perfectamente y quiero pasar a otra sección por ejemplo historia desaparece todo muy bien y me carga la sección historia perfecto pero pasado unos segundos me aparece la animación de las imagenes de la sección inicio encima de los contenidos de la sección historia. he probado con clearinterval(); y nada sigue igual, unloadmovie(); tampoco. :cry: :cry: :cry: :cry: :cry: :cry: :cry:

el boton inicio del contenedor tengo:

Código ActionScript :

on (release) {
   /*INICIO SECCION INICIO*/

   /*TITULO*/
   if (_root.iniciotitulo._y == 126) {

      _root.iniciotitulo.tween("_y",74,0.5,"easeInOutQuad");
      _root.iniciotitulo._alpha = 0;
      _root.iniciotitulo.alphaTo(80,0.5,"easeInOutQuad");

      /*SELECCION MENU*/
      _root.seleccion.tween("_x",267,1,"easeOutCirc");
      _root.seleccion.tween("_y",30,1,"easeOutCirc");
      _root.seleccion.resizeTo(39,1.6,0.8,"easeOutCirc");
      /*FONDOS*/
      _root.fondo_1.tween("_x",30,1,"easeInOutQuad");
      _root.fondo_1.tween("_y",162,1,"easeInOutQuad");
      _root.fondo_1.resizeTo(382,33,0.8,"easeInOutQuad");

      _root.fondo_2.tween("_x",372,1,"easeInOutQuad");
      _root.fondo_2.tween("_y",115,1,"easeInOutQuad");
      _root.fondo_2.resizeTo(387,585,0.8,"easeInOutQuad");

               /*CARGA INICIO en NIVEL 5*/
      loadMovie("inicio.swf", 5);
   } else {
      trace("la sección inicio ya está cargada");
   }
}}


en el boton historia del menu contenedor:

Código ActionScript :


on (release) {
   /*INICIO SECCION HISTORIA*/

   /*TITULO*/
   if (_root.historiatitulo._y == 155) {
      _root.historiatitulo.tween("_y",115,0.5,"easeInOutQuad");
      _root.historiatitulo._alpha = 0;
      _root.historiatitulo.alphaTo(80,0.5,"easeInOutQuad");

      /*SELECCION MENU*/
      _root.seleccion.tween("_x",328,1,"easeOutCirc");
      _root.seleccion.tween("_y",30,1,"easeOutCirc");
      _root.seleccion.resizeTo(57,1.6,0.8,"easeOutCirc");

      /*FONDOS*/
      _root.fondo_1.tween("_x",52,1,"easeInOutQuad");
      _root.fondo_1.tween("_y",155,1,"easeInOutQuad");
      _root.fondo_1.resizeTo(426,96,0.8,"easeInOutQuad");
      _root.fondo_2.tween("_x",478,1,"easeInOutQuad");
      _root.fondo_2.tween("_y",129,1,"easeInOutQuad");
      _root.fondo_2.resizeTo(298,276,0.8,"easeInOutQuad");

      /* CARGA HISTORIA EN NIVEL 10 */
      loadMovie("historia.swf", 10);
   } else {
      trace("la sección historia ya está cargada");
   }
   /*FIN SECCION HISTORIA*/

   /* INICIO FADE OUT'S*/

   /* OUT INICIO */
   if (_root.iniciotitulo._y == 74) {
      _root.iniciotitulo.tween("_y",126,0.5,"easeInOutQuad");
      _root.iniciotitulo._alpha = 80;
      _root.iniciotitulo.alphaTo(0,0.5,"easeInOutQuad");
      _level5._root.otonoinvierno.alphaTo(0,0.5,"easeInOutQuad");
      _level5._root.primaveraverano.alphaTo(0,0.5,"easeInOutQuad");
      _level5._root.iniciotexto.alphaTo(0,0.5,"easeInOutQuad");
      _level5._root.imagen1.alphaTo(0,0.5,"easeInOutQuad");
      _level5._root.imagen2.alphaTo(0,0.5,"easeInOutQuad");
      _level5._root.imagen3.alphaTo(0,0.5,"easeInOutQuad");
      unloadMovie(5);
   }



inicio.swf contiene este codigo

Código ActionScript :

/*carga inicial de imagenes*/
loadMovie("imagenes/inicio/imagen1.jpg", imagen1);
loadMovie("imagenes/inicio/imagen2.jpg", imagen2);
loadMovie("imagenes/inicio/imagen3.jpg", imagen3);
_root.imagen1._alpha = 0;
_root.imagen2._alpha = 0;
_root.imagen3._alpha = 0;
_root.imagen1.tween("_y",130,1,"easeInOutQuad");
_root.imagen2.tween("_y",526,1,"easeInOutQuad");
_root.imagen1.alphaTo(100,1,"easeInOutQuad");
_root.imagen2.alphaTo(100,1,"easeInOutQuad");

clearInterval(pasefotos);
pasefotos = setInterval(pase, 5000);

function pase() {
   if (_root.imagen1._y == 130 and _root.imagen2._y == 526) {
      _root.imagen1.tween("_y",-256,1,"easeInOutQuad");
      _root.imagen2.tween("_y",130,1,"easeInOutQuad");
      _root.imagen3._alpha = 0;
      _root.imagen3._y = 926;
      _root.imagen3._alpha = 100;
      _root.imagen3.tween("_y",526,1,"easeInOutQuad");

   } else if (_root.imagen2._y == 130 and _root.imagen3._y == 526) {
      _root.imagen2.tween("_y",-256,1,"easeInOutQuad");
      _root.imagen3.tween("_y",130,1,"easeInOutQuad");
      _root.imagen1._alpha = 0;
      _root.imagen1._y = 926;
      _root.imagen1._alpha = 100;
      _root.imagen1.tween("_y",526,1,"easeInOutQuad");

   } else if (_root.imagen3._y == 130 and _root.imagen1._y == 526) {
      _root.imagen3.tween("_y",-256,1,"easeInOutQuad");
      _root.imagen1.tween("_y",130,1,"easeInOutQuad");
      _root.imagen2._alpha = 0;
      _root.imagen2._y = 926;
      _root.imagen2._alpha = 100;
      _root.imagen2.tween("_y",526,1,"easeInOutQuad");

   }
}

Por mastunio

3 de clabLevel



 

safari
Citar            
MensajeEscrito el 19 Abr 2010 03:13 pm
perdon el problema que me hace es que cuando regreso a la sección inicio despues de haber pasado por otra sección el pase de diapositivas es mucho mas rapido que el intervalo preestablecido en el codigo, y si este paso lo repito varias veces (cambio a otra sección y vuelvo a la sección inicio) es mucho mas rapido!!!!
:shock: :shock: :shock: :shock: :shock: :shock:

es urgente por favor!!!! por que pasa esto????

Por mastunio

3 de clabLevel



 

safari

 

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