RM3.0
08-29-2009, 12:33 AM
function btnMoveActivate(event:MouseEvent):void
{
btnLogo.addEventListener(Event.ENTER_FRAME, btnMove);
btnMouseTracker.addEventListener(Event.ENTER_FRAME , btnMove);
}
function btnMove(event:Event):void
{
var Xpos:Number
var Xtrack:Number = btnMouseTracker.x;
var Xdif:Number = Xtrack - btnLogo.x;
var Xfriction:Number = .95;
btnMouseTracker.x = root.mouseX;
Xpos = Xtrack - (Xdif*Xfriction);
btnLogo.x = Xpos;
btnLogoMenu_mc.x = btnLogo.x - 45;
borderDetect.removeEventListener(MouseEvent.MOUSE_ OVER, btnMoveActivate);
borderDetect.addEventListener(MouseEvent.MOUSE_OUT , btnMoveDeactivate);
}
function btnMoveDeactivate(event:MouseEvent):void
{
btnMouseTracker.removeEventListener(Event.ENTER_FR AME, btnMove);
borderDetect.removeEventListener(MouseEvent.MOUSE_ OUT, btnMoveDeactivate);
borderDetect.addEventListener(MouseEvent.MOUSE_OVE R, btnMoveActivate);
}
borderDetect.addEventListener(MouseEvent.MOUSE_OVE R, btnMoveActivate);
Based on what I wrote here, I thought I would be able to make a zero alpha movie clip tracking the mouse stop when the mouse was off of a zero alpha, hit-detecting movie clip. I also thought that I could make the tracking movie clip continue to track when the mouse was back on the aforementioned hit-detecting movie clip.
However, it seems that what I wrote tracks the mouse and never stops, even upon moving away from the hit-detectnig movie clip. I figured that there was something that I wasn't seeing again, or something that I was missing, so maybe an extra pair of eyes would be able to help in this case.
Any assistance in this matter would be appreciated.
{
btnLogo.addEventListener(Event.ENTER_FRAME, btnMove);
btnMouseTracker.addEventListener(Event.ENTER_FRAME , btnMove);
}
function btnMove(event:Event):void
{
var Xpos:Number
var Xtrack:Number = btnMouseTracker.x;
var Xdif:Number = Xtrack - btnLogo.x;
var Xfriction:Number = .95;
btnMouseTracker.x = root.mouseX;
Xpos = Xtrack - (Xdif*Xfriction);
btnLogo.x = Xpos;
btnLogoMenu_mc.x = btnLogo.x - 45;
borderDetect.removeEventListener(MouseEvent.MOUSE_ OVER, btnMoveActivate);
borderDetect.addEventListener(MouseEvent.MOUSE_OUT , btnMoveDeactivate);
}
function btnMoveDeactivate(event:MouseEvent):void
{
btnMouseTracker.removeEventListener(Event.ENTER_FR AME, btnMove);
borderDetect.removeEventListener(MouseEvent.MOUSE_ OUT, btnMoveDeactivate);
borderDetect.addEventListener(MouseEvent.MOUSE_OVE R, btnMoveActivate);
}
borderDetect.addEventListener(MouseEvent.MOUSE_OVE R, btnMoveActivate);
Based on what I wrote here, I thought I would be able to make a zero alpha movie clip tracking the mouse stop when the mouse was off of a zero alpha, hit-detecting movie clip. I also thought that I could make the tracking movie clip continue to track when the mouse was back on the aforementioned hit-detecting movie clip.
However, it seems that what I wrote tracks the mouse and never stops, even upon moving away from the hit-detectnig movie clip. I figured that there was something that I wasn't seeing again, or something that I was missing, so maybe an extra pair of eyes would be able to help in this case.
Any assistance in this matter would be appreciated.