hei,
I am not able to restrict this code to scroll only the front_mc and back_mc, in the front_mc are nested buttons that work and showing content on click - but the mouse-movement gets captured all the time so also content of the menu gets scrolled, when mouse is moved. please help me guys, I am not fit enough to deal with it.
root.addEventListener(MouseEvent.MOUSE_MOVE,f);
var t:Timer=new Timer(40,0); t.addEventListener(TimerEvent.TIMER,moveF); function f(e:MouseEvent) { t.stop(); t.start(); } var speed:Number = .9;
function moveF(e:TimerEvent) { front_mc.x =speed*front_mc.x+(1-speed)*(stage.stageWidth-front_mc.width)*root.mouseX/stage.stageWidth; back_mc.x = speed*back_mc.x+(1-speed)*(stage.stageWidth-back_mc.width)*root.mouseX/stage.stageWidth; if (Math.abs(front_mc.x- (stage.stageWidth-front_mc.width)*root.mouseX/stage.stageWidth)<1 && Math.abs(back_mc.x-(stage.stageWidth-back_mc.width)*root.mouseX/stage.stageWidth)<1) { front_mc.x = (stage.stageWidth-front_mc.width)*root.mouseX/stage.stageWidth; back_mc.x = (stage.stageWidth-back_mc.width)*root.mouseX/stage.stageWidth; t.stop();
}
e.updateAfterEvent();
}