Comunidad de diseño web y desarrollo en internet online

Como logro hacer funciones que sirvan para todos [As3]

Citar            
MensajeEscrito el 12 Jul 2007 12:02 am
:D
Hola Flasheros :)
Tengo una pequeña duda.
Se puede hacer algo como esto:

Código :

boton1.addEventListener(MouseEvent.CLICK, drag);
boton2.addEventListener(MouseEvent.CLICK, drag);
boton3.addEventListener(MouseEvent.CLICK, drag);
function drag(e:MouseEvent){
this.startDrag();
}

Si hago esto...me dragea todo el Ecenario...
Como ago para que se dragee solo al cual se le iso click ¿? Sin necesidad de hacer varias funciones.
Osea como NO quiero es asi:

Código :

boton1.addEventListener(MouseEvent.CLICK, drag);
boton2.addEventListener(MouseEvent.CLICK, drag2);
boton3.addEventListener(MouseEvent.CLICK, drag3);
function drag(e:MouseEvent){
boton1.startDrag();
}
function drag2(e:MouseEvent){
boton2.startDrag();
}
function drag3(e:MouseEvent){
boton3.startDrag();
}


Ojala sepan como se hace.
La otra duda es como Restrinjo el Drag..
osea que solo Se pueda X, o solo se Pueda Y
O solo se pueda un Sierto Rango... Se que se puede..pero no se como! :o ^^

Por JaLeRu

Claber

1913 de clabLevel

7 tutoriales

Genero:Masculino  

Existo

firefox
Citar            
MensajeEscrito el 12 Jul 2007 02:09 am

Código :

function drag(event:MouseEvent) {
   event.target.startDrag();
}

bye!

Por Zguillez

BOFH

10744 de clabLevel

85 tutoriales
17 articulos
3 ejemplos

Genero:Masculino   Bastard Operators From Hell Héroes Team Cristalab Editores

BCN

firefox
Citar            
MensajeEscrito el 12 Jul 2007 10:04 pm
Muchas Gracias!!! :D
Si sabes lo del Drag me avisas :D
Y ademas me gustaria saber como ocupar el swapDepth(); que fue eliminado en AS3

Por JaLeRu

Claber

1913 de clabLevel

7 tutoriales

Genero:Masculino  

Existo

firefox

 

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