Fade Image script parpadea después de 11 imágenes

  • cranky
  • Born
  • Born
  • No Avatar
  • Registrado: Jun 05, 2008
  • Mensajes: 2
  • Status: Offline

Nota Junio 9th, 2008, 8:41 pm

He encontrado (gracias ICECOLD) y esta vez ActionScript para adaptarse a mis necesidades, que está a la decoloración 14 imágenes (clips) dentro y fuera y repetir.
Todas las obras bien hasta mcImage11 alrededor de los rollos, entonces parpadea rápidamente los próximos 3 (mcImage11, mcImage12 & mcImage13) y no se desvanece. Una vez que los bucles en torno a mcImage0 más su mcImage11 todo bien hasta que se alcance de nuevo.
Si elimino los últimos 3 clips que funciona bien. ¿Existe un límite en el número de artículos que esto trabaja? He intentado todos los MCs apilados unos a otros en una sola capa con Alpha set @ 0, y también de dividirlos en 2 capas, pero no hizo la diferencia.
Mis 14 MCS se nombran mcImage0 - mcImage13 y contienen una estática JPEG cada uno.

Im un script principiante así que si real obvia su ser fácil de mí...
Uso MX2004 Professional.

Toma nota de ejecución:
Han descubierto que si se maxImgCount var = 11; las 11 imágenes se desvanecen, pero si bien me puse a maxImgCount var = 12; o superior en los últimos pocos mcs parpadeo.


Código: [ Select ]
import mx.transitions.Tween;
import mx.transitions.easing.*;

function GetNextID(crtID, maxCount)
{
crtID++;
if (crtID >= maxCount)
{
     crtID = 0;
}
return crtID;
}

function SetFade()
{
mcFadeOutImg = this["mcImage"+crtImgID];
crtImgID = GetNextID(crtImgID, maxImgCount);
mcFadeInImg = this["mcImage"+crtImgID];
trace(mcFadeOutImg+":in:"+mcFadeInImg);
tFadeOut = new Tween(mcFadeOutImg, "_alpha", None.easeOut, 100 , 0, 15);
tFadeIn = new Tween(mcFadeInImg, "_alpha", None.easeOut, 0 , 100, 15);
tFadeIn.stop();

}
var tFadeOut:Tween;
var tFadeIn:Tween;
var crtImgID = 0;
var maxImgCount = 14;
var bFadeIn = false;
SetFade();

onEnterFrame = function()
{
if (tFadeOut.position < 60 && !bFadeIn)
{
     tFadeIn.start();
     bFadeIn = true;
}
if (tFadeIn.position == 100)
{
     delete tFadeOut;
     delete tFadeIn;
     bFadeIn = false;
     SetFade();
}
}
stop();
  1. import mx.transitions.Tween;
  2. import mx.transitions.easing.*;
  3. function GetNextID(crtID, maxCount)
  4. {
  5. crtID++;
  6. if (crtID >= maxCount)
  7. {
  8.      crtID = 0;
  9. }
  10. return crtID;
  11. }
  12. function SetFade()
  13. {
  14. mcFadeOutImg = this["mcImage"+crtImgID];
  15. crtImgID = GetNextID(crtImgID, maxImgCount);
  16. mcFadeInImg = this["mcImage"+crtImgID];
  17. trace(mcFadeOutImg+":in:"+mcFadeInImg);
  18. tFadeOut = new Tween(mcFadeOutImg, "_alpha", None.easeOut, 100 , 0, 15);
  19. tFadeIn = new Tween(mcFadeInImg, "_alpha", None.easeOut, 0 , 100, 15);
  20. tFadeIn.stop();
  21. }
  22. var tFadeOut:Tween;
  23. var tFadeIn:Tween;
  24. var crtImgID = 0;
  25. var maxImgCount = 14;
  26. var bFadeIn = false;
  27. SetFade();
  28. onEnterFrame = function()
  29. {
  30. if (tFadeOut.position < 60 && !bFadeIn)
  31. {
  32.      tFadeIn.start();
  33.      bFadeIn = true;
  34. }
  35. if (tFadeIn.position == 100)
  36. {
  37.      delete tFadeOut;
  38.      delete tFadeIn;
  39.      bFadeIn = false;
  40.      SetFade();
  41. }
  42. }
  43. stop();
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Junio 9th, 2008, 8:41 pm

Publicar Información

  • Total de mensajes en este tema: 1 mensaje
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 46 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC