frank_n
01-14-2009, 03:36 PM
hallo,
I am stuck since 2! days with this problem:
at main timeline there is front_mc. if ones mouse is over this menu it scrolls left/right according to mousemovement. works great.
inside the front_mc are the buttons which call via gotoAndStop the content on stage on this timeline not the Main TL.
The problem is, if content got called and is on the stage and I move again to the menu, the content scrolls horizontal analogue to the menu with the menu, but of course, only the menu should scroll.
How can I solve this?
the code for the parallaxing scrolling of front_mc and back_mc:
front_mc.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();
}
it would be so great if one can shed light on this, I read through so many threads.
I am stuck since 2! days with this problem:
at main timeline there is front_mc. if ones mouse is over this menu it scrolls left/right according to mousemovement. works great.
inside the front_mc are the buttons which call via gotoAndStop the content on stage on this timeline not the Main TL.
The problem is, if content got called and is on the stage and I move again to the menu, the content scrolls horizontal analogue to the menu with the menu, but of course, only the menu should scroll.
How can I solve this?
the code for the parallaxing scrolling of front_mc and back_mc:
front_mc.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();
}
it would be so great if one can shed light on this, I read through so many threads.