Ver Mensaje Individual
  #5 (permalink)  
Antiguo 30/11/2007, 13:29
Oahu
 
Fecha de Ingreso: noviembre-2007
Ubicación: Madrid
Mensajes: 41
Antigüedad: 16 años, 5 meses
Puntos: 0
Re: problema conversión flashMX-flash8

Hola de nuevo!A ver este es el código que tengo puesto en mi proyecto, yo creo que es el mismo pero na las imágenes no se mueven al mover las flechas del escroll!no tengo ni idea de que le ocurre, Mira a ver si tu lo entiendes,muchas gracias!!!


//------------------------------------------------------------
// declarar variables
//----------------------------------------------------------------

desplazamiento = 118;
mScroll = (imagenes._height/desplazamiento)-1;
mMaxScroll = imagenes._height-desplazamiento;
izquierda = boton1._x;
superior = boton1._y;
derecha = boton1._x;
inferior = desplazamiento;
anchoImagen = imagenes._width+15;
boton1._y = superior;
boton2._y = inferior;
moverboton2 = true;
//----------------------------------------------------------------
// creación de mascara
//----------------------------------------------------------------
this.createEmptyMovieClip("mascara", 1);
mascara.lineStyle(1, 0x000000);
mascara.beginFill(0x000000);
mascara.moveTo(0, 0);
mascara.lineTo(anchoImagen, 0);
mascara.lineTo(anchoImagen, desplazamiento);
mascara.lineTo(0, desplazamiento);
mascara.lineTo(0, 0);
imagenes.setMask(this.mascara);
this.onEnterFrame = function() {
//----------------------------------------------------------------
// intercambia las posición de los botones en el eje _Y
//----------------------------------------------------------------
if (moverboton2 == false) {
boton1._y = (superior+(inferior-boton2._y)+3*boton1._y)/4;
}
if (moverboton2 == true) {
boton2._y = ((inferior+(superior-boton1._y))+3*boton2._y)/4;
}
//----------------------------------------------------------------
// manejo del boton 1
//----------------------------------------------------------------
boton1.onPress = function() {
moverboton2 = true;
startDrag(this, false, izquierda, superior, derecha, inferior);
};
boton1.onRelease = boton1.onReleaseOutside=function () {
stopDrag();
};
//----------------------------------------------------------------
// manejo del boton 2
//----------------------------------------------------------------
boton2.onPress = function() {
moverboton2 = false;
startDrag(this, false, izquierda, superior, derecha, inferior);
};
boton2.onRelease = boton2.onReleaseOutside=function () {
stopDrag();
};
//----------------------------------------------------------------
// cambia dirección flecha botón según posición q ocupan
//----------------------------------------------------------------
if ((boton1._y-superior)<=2) {
boton1.gotoAndStop("abajo");
} else if ((inferior-boton1._y)<=2) {
boton1.gotoAndStop("arriba");
}
//
if ((boton2._y-superior)<=2) {
boton2.gotoAndStop("abajo");
} else if ((inferior-boton2._y)<=2) {
boton2.gotoAndStop("arriba");
}
//----------------------------------------------------------------
// scroll
//----------------------------------------------------------------
posicion = Math.round((superior-boton1._y)*mScroll);
if (imagenes._y<mMaxScroll+barra._height) {
imagenes._y = (posicion+3*imagenes._y)/4;
}
imagy = imagenes._y;
boton1y = boton1._y;
};