Comunidad de diseño web y desarrollo en internet online

Problema con getNextHighestDepth()

Citar            
MensajeEscrito el 12 Mar 2008 10:22 pm
Hola, tengo este codigo

Código :

agre();
function agre() {
   attachMovie("avi","av",getNextHighestDepth());
   av.tip.attachMovie("caja","ca",getNextHighestDepth());
   con = 0;
   av.tip.ca._y = 27;
   av.tip.ca._x = 12;
   av._y = 160;
}
function pos() {
   caj._x = av._x;
   caj._y = av._y+40;
}
this.onEnterFrame = function() {
   if (av._x == 660) {
      removeMovieClip("av");
      agre();
   }
   av._x += 5;
   con++;
   if (con == 55) {
      av.tip.play();
      removeMovieClip(caj);
      av.tip.ca.removeMovieClip();
      attachMovie("caja","caj",getNextHighestDepth());
      pos();
   }
   if (av.hitTest(caj) == false) {
      caj.play();
   }
   if (caj._currentframe == 1) {
      caj._y += 10;
   } else {
      caj._y+=2;
   }
};

La cosa es que el MC de instancia caj solo coje 1 como profundidad, y me daña la presentacion al incluirse en la esquina izquierda superior....HELP :shock:

Por jozet77

35 de clabLevel



Genero:Masculino  

Ecuador

firefox
Citar            
MensajeEscrito el 13 Mar 2008 02:11 am
Si quieres que coja el siguiente nivel de av.tip y no el de _root, usa:

av.tip.attachMovie("caja","ca",av.tip.getNextHighestDepth());

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 13 Mar 2008 02:37 pm
:o oye pero si quiero que coja directamente el siguiente depth de "ca", o por lo menos que no se me repita el mismo depth cada vez que comienza de nuevo.....GRacias. :D

Por jozet77

35 de clabLevel



Genero:Masculino  

Ecuador

firefox
Citar            
MensajeEscrito el 13 Mar 2008 02:57 pm
La misma ayuda te lo indica:

clipDelQueQuieroCojerLaSiguienteProfundidad.getNextHighestDepth()

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 13 Mar 2008 05:18 pm
oye ya revise bien, y valio, pero al hacerle unos cambios al script

Código :

      
num++
attachMovie("caja","caj"+num,getNextHighestDepth(),{_x:av._x, _y:av._y+40});
   with (caj+num) {
      if (av.hitTest(caj+num) == false) {
         play();
      }
      if (caj+num._currentframe == 1) {
         _y += 10;
      } else {
         _y += 2;
      }
   }

ese es solo un pedazo, la cosa es que no reconoce el caj+num al attacharlo :shock: , si alguien sabe por que.......... gracias :)

Por jozet77

35 de clabLevel



Genero:Masculino  

Ecuador

firefox
Citar            
MensajeEscrito el 13 Mar 2008 05:23 pm
Pon esto:

t = attachMovie("caja","caj"+num,getNextHighestDepth(),{_x:av._x, _y:av._y+40});
with (t) {

Y reemplaza caj+num por t, ya que concatenar un string con un nro no te da una referencia a un MC

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 13 Mar 2008 05:40 pm
ya valio bien, gracias por tu tiempo............ :)

Por jozet77

35 de clabLevel



Genero:Masculino  

Ecuador

firefox

 

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