Foros del Web » Creando para Internet » Flash y Actionscript »

Problema con rueda del mouse

Estas en el tema de Problema con rueda del mouse en el foro de Flash y Actionscript en Foros del Web. Saludos, tengo un problema y recurro al foro a ver si alguien tiene la solución. Tengo en un swf un scroll que funciona con rueda ...
  #1 (permalink)  
Antiguo 14/08/2009, 13:10
 
Fecha de Ingreso: septiembre-2008
Mensajes: 32
Antigüedad: 15 años, 7 meses
Puntos: 0
Problema con rueda del mouse

Saludos, tengo un problema y recurro al foro a ver si alguien tiene la solución.
Tengo en un swf un scroll que funciona con rueda del mouse. Ese swf llama por medio de loadmovieNum a otro swf en un nivel superior, que también tiene un scroll.
Quiero que ambos fuincionen con la reuda del mouse independientemente, pero me sucede que no importa donde el mouse esté situado ambos scrolls se mueven.

¿Cómo hago para que la rueda del mouse sólo funcione cuando estoy sobre el scroll que le corresponde mover?

Gracias a todos por adelantado. Les dejo el código del scroll:

scrolling = function () {
var scrollHeight:Number = scrollTrack._height;
var contentHeight:Number = contentMain._height;
var scrollFaceHeight:Number = scrollFace._height;
var maskHeight:Number = maskedView._height;
var initPosition:Number = scrollFace._y=scrollTrack._y;
var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
var left:Number = scrollTrack._x;
var top:Number = scrollTrack._y;
var right:Number = scrollTrack._x;
var bottom:Number = scrollTrack._height-scrollFaceHeight+scrollTrack._y;
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);

scrollFace.onPress = function() {
var currPos:Number = this._y;
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
dy = Math.abs(initPosition-this._y);
contentMain._y = Math.round(dy*-1*moveVal+initContentPos);
};
};
scrollFace.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};
btnUp.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._y+speed<maskedView._y) {
if (scrollFace._y<=top) {
scrollFace._y = top;
} else {
scrollFace._y -= speed/moveVal;
}
contentMain._y += speed;
} else {
scrollFace._y = top;
contentMain._y = maskedView._y;
delete this.onEnterFrame;
}
};
};
btnUp.onDragOut = function() {
delete this.onEnterFrame;
};
btnUp.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._y-speed>finalContentPos) {
if (scrollFace._y>=bottom) {
scrollFace._y = bottom;
} else {
scrollFace._y += speed/moveVal;
}
contentMain._y -= speed;
} else {
scrollFace._y = bottom;
contentMain._y = finalContentPos;
delete this.onEnterFrame;
}
};
};
btnDown.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onDragOut = function() {
delete this.onEnterFrame;
};

if (contentHeight<maskHeight) {
scrollFace._visible = false;
btnUp.enabled = false;
btnDown.enabled = false;
} else {
scrollFace._visible = true;
btnUp.enabled = true;
btnDown.enabled = true;
}
};

mouse = new Object();
mouse.onMouseWheel = function(rueda) {
contentMain._y += rueda;
};
Mouse.addListener(mouse);


scrolling();
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:40.