Comunidad de diseño web y desarrollo en internet online

Ayuda con Enabled

Citar            
MensajeEscrito el 19 Dic 2008 02:43 pm
No se como hacer para que cuando los clips se liberen en las zonas correctas ya no puedan volver a moverse..
Necesito que me ayuden por favor...
Gracias de antemano...
Aquí está el Código:

Código :

on (press) {
   startDrag("_root.may1", true);
}
on (release) {
   stopDrag();
   if (_root.may1.hitTest(_root.dest1)) {
      _root.may1._x = _root.dest1._x;
      _root.may1._y = _root.dest1._y;
      _root.contt = _root.contt + 1;
      _root.may1.enabled = false;
   } else if (_root.may1.hitTest(_root.dest5)) {
      _root.may1._x = _root.dest5._x;
      _root.may1._y = _root.dest5._y;
      _root.contt = _root.contt + 1;
      _root.may1.enabled = false;
   } else if (_root.may1.hitTest(_root.dest6)) {
      _root.may1._x = _root.dest6._x;
      _root.may1._y = _root.dest6._y;
      _root.contt = _root.contt + 1;
      _root.may1.enabled = false;


   } else {

      _root.may1._x = _root.may1iniX;
      _root.may1._y = _root.may1iniY;

   }
}

Por Bernad Qr.

21 de clabLevel



 

msie7
Citar            
MensajeEscrito el 19 Dic 2008 06:00 pm
Busca dropTarget en la ayuda, viene con el ejemplito del cubo que es justo eso

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox
Citar            
MensajeEscrito el 19 Dic 2008 07:32 pm
Me dices para acceda a la ayuda de flash??
Gracias!!

Por Bernad Qr.

21 de clabLevel



 

msie7
Citar            
MensajeEscrito el 19 Dic 2008 07:57 pm
La función Enabled es para botones, si lo quieres usar en MC no te va funcionar, lo que puedes hacer es hacer una función que te active el Drag y cuando este en su destino la desactives.
Otra forma sin AS es agregar un frame interno dentro de tu movieClip donde no se encuentren acciones con eso al cumplir la condición mandas al otro frame donde no tengas codigo y listo.

Dos Frames:
En el primero tienes el codigo de drag ya sea en un boton o en el MC
en el segundo Frame solo dejas tu MC sin acciones y listo emulas la inhabilitación.

Código ActionScript :

on (press) {
   startDrag("_root.may1", true);
}
on (release) {
   stopDrag();
   if (_root.may1.hitTest(_root.dest1)) {
      _root.may1._x = _root.dest1._x;
      _root.may1._y = _root.dest1._y;
      _root.contt = _root.contt + 1;
     // _root.may1.enabled = false;
     // Agregarias solo una linea como esta
      _root.may1.gotoAndStop(2);
   } else if (_root.may1.hitTest(_root.dest5)) {
      _root.may1._x = _root.dest5._x;
      _root.may1._y = _root.dest5._y;
      _root.contt = _root.contt + 1;
      _root.may1.enabled = false;
   } else if (_root.may1.hitTest(_root.dest6)) {
      _root.may1._x = _root.dest6._x;
      _root.may1._y = _root.dest6._y;
      _root.contt = _root.contt + 1;
      _root.may1.enabled = false;


   } else {

      _root.may1._x = _root.may1iniX;
      _root.may1._y = _root.may1iniY;

   }
}

Por flashreloco

Claber

1310 de clabLevel

1 tutorial
1 articulo

Genero:Masculino  

Webdesigner & Mandilon 2.0

msie
Citar            
MensajeEscrito el 20 Dic 2008 11:30 am
Muchas Gracias...
No sabía que enabled era solo para botones y yo tengo dentro de mi clip de pelicula un botón..
Entonces solo debo rutearlo y listo...

Código :

_root.may1.btn10.enabled = false;

Por Bernad Qr.

21 de clabLevel



 

msie7

 

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