OK, me dan hasta...Necesito ayuda!

  • Abelius
  • Proficient
  • Proficient
  • Avatar de Usuario
  • Registrado: Sep 17, 2004
  • Mensajes: 260
  • Loc: Miami Beach, FL, USA
  • Status: Offline

Nota Octubre 26th, 2004, 9:18 am

He estado buscando en este foro de dos días, y no he encontrado mi respuesta...
Aquí está el problema:

He creado una dinámica _root.attachMovie usando mc y puse dos botones en el escenario principal. Uno de ellos envía el objeto un poco más arriba, theother uno un poco deprimido, con easing con destX y desty. Todo está bien y aquí está el código si es necesario:

Código: [ Select ]
this = _root.attachMovie("box_1_mc", "mc", layerNumber);
layerNumber++;
// ==============================================
function move_down(obj, initpos) {
    var destY = initpos + 55;
    move_y(obj, destY);
}
function move_up(obj, initpos) {
    var destY = initpos - 55;
    move_y(obj, destY);
}
// ==============================================
function move_y(obj, destY) {
    eval(obj).onEnterFrame = function() {
        eval(obj)._y += (destY - eval(obj)._y) / 4;
        Math.ceil(eval(obj)._y) == destY ? delete eval(obj).onEnterFrame : doNothing();
    };
}
// ==============================================
_root.down_btn.onRelease = function() {
    move_down(_root.mc, getProperty(_root.mc, _y));
};
_root.up_btn.onRelease = function() {
    move_up(_root.mc, getProperty(_root.mc, _y));
};
  1. this = _root.attachMovie("box_1_mc", "mc", layerNumber);
  2. layerNumber++;
  3. // ==============================================
  4. function move_down(obj, initpos) {
  5.     var destY = initpos + 55;
  6.     move_y(obj, destY);
  7. }
  8. function move_up(obj, initpos) {
  9.     var destY = initpos - 55;
  10.     move_y(obj, destY);
  11. }
  12. // ==============================================
  13. function move_y(obj, destY) {
  14.     eval(obj).onEnterFrame = function() {
  15.         eval(obj)._y += (destY - eval(obj)._y) / 4;
  16.         Math.ceil(eval(obj)._y) == destY ? delete eval(obj).onEnterFrame : doNothing();
  17.     };
  18. }
  19. // ==============================================
  20. _root.down_btn.onRelease = function() {
  21.     move_down(_root.mc, getProperty(_root.mc, _y));
  22. };
  23. _root.up_btn.onRelease = function() {
  24.     move_up(_root.mc, getProperty(_root.mc, _y));
  25. };

Todo lo que tengo en mi biblioteca es el elemento llamado "box_1_mc" con su vinculación, y el botón.
Hago clic en el botón UP y sube, facilitando bien. Lo mismo con el botón de abajo. Hasta ahora, todo bien...

Pero, ¿cómo puedo hacer que la facilidad, parar entonces Ease Down...?

Traté este código:
Código: [ Select ]
_root.bounce_btn.onRelease = function() {
    move_up(_root.mc, getProperty(_root.mc, _y));
    move_down(_root.mc, getProperty(_root.mc, _y));
};
  1. _root.bounce_btn.onRelease = function() {
  2.     move_up(_root.mc, getProperty(_root.mc, _y));
  3.     move_down(_root.mc, getProperty(_root.mc, _y));
  4. };

Doesnt work...Pleeease, por favor, por favor. ¿Alguna idea?
Cordially,
Abel K - Miami Beach, FL, USA
http://www.worldkit.com
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Octubre 26th, 2004, 9:18 am

  • still learning
  • Born
  • Born
  • No Avatar
  • Registrado: Nov 01, 2004
  • Mensajes: 3
  • Status: Offline

Nota Noviembre 1st, 2004, 6:49 am

intente esto:

Código: [ Select ]
function move_upDown(obj, origin) {
  var destY = origin-55;
  eval(obj).onEnterFrame = function() {
   eval(obj)._y += (destY - eval(obj)._y) / 4;
   if(Math.ceil(eval(obj)._y) == destY) {
     delete eval(obj).onEnterFrame;
     move_down(_root.mc, getProperty(_root.mc, _y));
   }
  };
}

_root.bounce_btn.onRelease = function() {
  move_upDown(_root.mc, getProperty(_root.mc, _y))
};
  1. function move_upDown(obj, origin) {
  2.   var destY = origin-55;
  3.   eval(obj).onEnterFrame = function() {
  4.    eval(obj)._y += (destY - eval(obj)._y) / 4;
  5.    if(Math.ceil(eval(obj)._y) == destY) {
  6.      delete eval(obj).onEnterFrame;
  7.      move_down(_root.mc, getProperty(_root.mc, _y));
  8.    }
  9.   };
  10. }
  11. _root.bounce_btn.onRelease = function() {
  12.   move_upDown(_root.mc, getProperty(_root.mc, _y))
  13. };

Publicar Información

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