My listener isn't listening

well, something like that…

i’m working on a draggable menu system with a mouse listener that says “…onMouseDown, do this”… you know how it goes.

anyway, i’ve got it working except for one part… here is what i have so far (a summary)

  • i have a MovieClip that follows / takes place of my cursor
  • onMouseDown the listener is removed, my cursor is visible, and the MovieClip expands to reveal some buttons
  • onRelease of those now revealed buttons, the MovieClip contracts, my cursor is hidden, and my listener is added.

what i’m having issues with is, what if the user expands the MovieClip but doesn’t select one of my hidden buttons. thats where my problem lies… i need to set up a onRollOut type function that says…

if(_xmouse>cursor_mc._width+20 || _xmouse>cursor_mc._width-20 || _ymouse>cursor_mc._height+20 || _ymouse>cursor_mc._height-20){
do this();
}

… but that script doesn’t work.

here is my current script:

//////////////////////////////////////////////// MOUSE AND CURSOR FUNCTIONS
Mouse.hide();

var mouseListener:Object = new Object();

mouseListener.onMouseMove = function() {
cursor_mc._x = _xmouse;
cursor_mc._y = _ymouse;
updateAfterEvent();
}

mouseListener.onMouseDown = function() {
Mouse.removeListener(mouseListener);
cursor_mc.gotoAndPlay(“expand”);
Mouse.show();
}

mouseListener.onMouseUp = function() {
Mouse.addListener(mouseListener);
cursor_mc.gotoAndPlay(“normal”);
Mouse.hide();
}

cursor_mc.theColors.redBtn.onRelease = function(){
trace(“Red”);
Mouse.addListener(mouseListener);
cursor_mc.gotoAndPlay(“normal”);
Mouse.hide();
}

cursor_mc.theColors.greenBtn.onRelease = function(){
trace(“Green”);
Mouse.addListener(mouseListener);
cursor_mc.gotoAndPlay(“normal”);
Mouse.hide();
}

cursor_mc.theColors.blueBtn.onRelease = function(){
trace(“Blue”);
Mouse.addListener(mouseListener);
cursor_mc.gotoAndPlay(“normal”);
Mouse.hide();
}

cursor_mc.theColors.orangeBtn.onRelease = function(){
trace(“Orange”);
Mouse.addListener(mouseListener);
cursor_mc.gotoAndPlay(“normal”);
Mouse.hide();
}

cursor_mc.theColors.pinkBtn.onRelease = function(){
trace(“Pink”);
Mouse.addListener(mouseListener);
cursor_mc.gotoAndPlay(“normal”);
Mouse.hide();
}

Mouse.addListener(mouseListener);
//////////////////////////////////////////////// MOUSE AND CURSOR FUNCTIONS

hope you got all that!

thanks,
Andre