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:
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));
};
- 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));
- };
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:
_root.bounce_btn.onRelease = function() {
move_up(_root.mc, getProperty(_root.mc, _y));
move_down(_root.mc, getProperty(_root.mc, _y));
};
- _root.bounce_btn.onRelease = function() {
- move_up(_root.mc, getProperty(_root.mc, _y));
- move_down(_root.mc, getProperty(_root.mc, _y));
- };
Doesnt work...Pleeease, por favor, por favor. ¿Alguna idea?
Cordially,
Abel K - Miami Beach, FL, USA
http://www.worldkit.com