Ayuda con Action Script 2

  • ivfi3
  • Born
  • Born
  • No Avatar
  • Registrado: Ago 29, 2012
  • Mensajes: 2
  • Status: Offline

Nota Agosto 29th, 2012, 2:03 pm

Amigos, les pido ayuda con este código, es para hacer una especie de puzzle pero no funciona; les dejo el código del botón "p1".
"p1copy" es un movieclip que se encuentra en el lugar donde debe ir la pieza.
Además de este sólo hay código en el fotograma para hacer invisible "p1copy"
El error consiste en que donde quiera que haga el "release" regresa a la posición original; no hace la función de ocultar "p1" y hacer visible "p1copy"
Espero me puedan ayudar, gracias
Código: [ Select ]
on (press) {
    startDrag("p1");
}
on (release) {
    stopDrag();
}
on (release) {
    if (_droptarget eq "p1copy")
    {
        setProperty("p1", _visible, false);
        setProperty("p1copy", _visible, true);
    }
    else
    {
        setProperty("p1", _x, "707");
        setProperty("p1", _y, "276");
    }
}
  1. on (press) {
  2.     startDrag("p1");
  3. }
  4. on (release) {
  5.     stopDrag();
  6. }
  7. on (release) {
  8.     if (_droptarget eq "p1copy")
  9.     {
  10.         setProperty("p1", _visible, false);
  11.         setProperty("p1copy", _visible, true);
  12.     }
  13.     else
  14.     {
  15.         setProperty("p1", _x, "707");
  16.         setProperty("p1", _y, "276");
  17.     }
  18. }
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Agosto 29th, 2012, 2:03 pm

  • Zealous
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Abr 15, 2011
  • Mensajes: 1195
  • Loc: Sydney
  • Status: Offline

Nota Agosto 30th, 2012, 11:00 pm

editado......volver a comprobar

(sólo tenga en cuenta no el 100% en AS)

podría ser = eq

Código: [ Select ]
on (release) {
  if (_droptarget eq "p1copy")
  {
  1. on (release) {
  2.   if (_droptarget eq "p1copy")
  3.   {

He estado mirando estas 2 escuadras abiertas pensando que hay 1 demasiados.

Código: [ Select ]
on (release) {
  if (_droptarget eq "p1copy")
  {setProperty("p1", _visible, false);
   setProperty("p1copy", _visible, true);}
  }

  else
  1. on (release) {
  2.   if (_droptarget eq "p1copy")
  3.   {setProperty("p1", _visible, false);
  4.    setProperty("p1copy", _visible, true);}
  5.   }
  6.   else


Creo que he tenido un día largo pero estoy pensando en que no haber cerrado correctamente las variables.

necesitaría probarlo más pero que se ve cerca de trabajo leerlo.

idk Dime lo que piensas. buena oportunidad estoy mal lol
  • ivfi3
  • Born
  • Born
  • No Avatar
  • Registrado: Ago 29, 2012
  • Mensajes: 2
  • Status: Offline

Nota Agosto 31st, 2012, 8:38 am

Gracias por la respuesta ya encontró un código funcional; Este anexo que lo necesiten. Ambas instancias deben ser MC
Código: [ Select ]
on (press) {
    startDrag(this);
    this.swapDepths(100);
    
}
on (release) {
    stopDrag();
}
on (release) {
    if (_droptarget eq "/p1copy")
    {
        setProperty(this, _x,387);
        setProperty(this, _y, 519);
    }
    else
    {
        setProperty(this, _x, "707");
        setProperty(this, _y, "276");
    }
}
  1. on (press) {
  2.     startDrag(this);
  3.     this.swapDepths(100);
  4.     
  5. }
  6. on (release) {
  7.     stopDrag();
  8. }
  9. on (release) {
  10.     if (_droptarget eq "/p1copy")
  11.     {
  12.         setProperty(this, _x,387);
  13.         setProperty(this, _y, 519);
  14.     }
  15.     else
  16.     {
  17.         setProperty(this, _x, "707");
  18.         setProperty(this, _y, "276");
  19.     }
  20. }
  • Zealous
  • Guru
  • Guru
  • Avatar de Usuario
  • Registrado: Abr 15, 2011
  • Mensajes: 1195
  • Loc: Sydney
  • Status: Offline

Nota Agosto 31st, 2012, 10:53 pm

veo los cambios, bien que tienes que trabajar.

Publicar Información

  • Total de mensajes en este tema: 4 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 39 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