I have attached the updated .fla
Had to change your symbol so that registration is from 0 for x (since we are moving horizontally).
The code change was as given below:
Code:
var myShape:Shape = new Shape()
myShape.graphics.beginFill(0x7E00E3);
myShape.graphics.drawRect(50,10,450, 100)
addChild(myShape)
menu_mc.mask=myShape
stage.addEventListener(Event.ENTER_FRAME, movemenu);
function movemenu(myevent:Event):void {
menu_mc.x = menu_mc.x + (0.5 * myShape.width - mouseX) / 10;
if (menu_mc.x>0) {
trace("came in here")
menu_mc.x=0;
}
if(menu_mc.x < -((menu_mc.width - myShape.width) - 50)) // 50 is because myShape starts from 50...you might want to take this into a variable
{
menu_mc.x = -((menu_mc.width - myShape.width) - 50)
}
}