Comunidad de diseño web y desarrollo en internet online

Problema con OnRelease!!!

Citar            
MensajeEscrito el 12 Ago 2009 09:31 pm
Buenas buenas, tengo una pequeña duda, se me presenta el siguiente problema...

LLamo dos clips de pelicula de la biblioteca con attachmovie y les aplico la funcion de start y stopDrag, el problema ocurre cuando quiero soltar un clip sobre el otro. Tengo entendido que cada mc tiene un nivel de profundidad y ahí está el detalle, el que esta sobre el otro no presenta problema, pero si arrastro el que esta en el "nivel bajo" hasta el otro mc que esta en "nivel alto", suelto el boton del mouse y se queda pegado como si no lo hubiera hecho...

Espero me halla hecho entender y alguien me pueda ayudar!!!

este es el codigo:

Código :


Objini = new Object()
Objini.onPress = function(){this.startDrag();}
Objini.onRelease = function(){this.stopDrag();}

attachMovie("ca","instancia",0,Objini);
attachMovie("ca","instancia2",1,Objini);
instancia._x=200
instancia._y=200
instancia2._x=100
instancia2._y=200



y aquí el swf --->http://www.megaupload.com/?d=TUITTD1C

Por DARKEASC

2 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 13 Ago 2009 12:12 am
intenta antes de el starDrag poner algo asi

Código ActionScript :

this.getNextHighestDepth();

con eso la se mantendria arriba el movieclip
creo :P

Por tribak

Claber

2448 de clabLevel

6 tutoriales

Genero:Masculino   Héroes

Fotógrafo o algo

firefox
Citar            
MensajeEscrito el 13 Ago 2009 12:40 am
no tienes que aclarar que es un MC=?

Por sforero

478 de clabLevel

1 tutorial

 

social media expert world

msie8
Citar            
MensajeEscrito el 15 Ago 2009 08:54 am

tribak escribió:

intenta antes de el starDrag poner algo asi

Código ActionScript :

this.getNextHighestDepth();

con eso la se mantendria arriba el movieclip
creo :P


No me sirvio de nada... alguna otra idea???

Por DARKEASC

2 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 15 Ago 2009 09:32 am
he dado con la "solucion" aunque me parece demasiado engorrosa para algo como tan simple...

Código :

Objini = new Object()
Objini.onPress = function(){
this.startDrag();
if(instancia.getDepth() < instancia2.getDepth()){
instancia.swapDepths(instancia2)
}
}

Objini.onRelease = function(){this.stopDrag();}

Objini2 = new Object()
Objini2.onPress = function(){
this.startDrag();
if(instancia2.getDepth() < instancia.getDepth()){
instancia2.swapDepths(instancia)
}
}
Objini2.onRelease = function(){this.stopDrag();}


attachMovie("ca","instancia",0,Objini);
attachMovie("ca2","instancia2",1,Objini2);
instancia._x=200
instancia._y=200
instancia2._x=100
instancia2._y=200

Por DARKEASC

2 de clabLevel



Genero:Masculino  

firefox

 

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