Stage boarder

i tried to modify this code so:
1- the boarder of the ball hit exactly the the boarder of stage
2- when the ball hit any boarder of stage it go in reverse way in different directions


stage.frameRate = 30;
ball_mc.addEventListener(Event.ENTER_FRAME, moveBall);
function moveBall(event:Event):void {
    if (ball_mc.x < stage.stageWidth - ball_mc.width + 40&& ball_mc.y < stage.stageHeight - ball_mc.height + 30) {
        ball_mc.x += 10;
        ball_mc.y += 10;
    } else if (ball_mc.x == stage.stageWidth && ball_mc.y == stage.stageHeight) {
        ball_mc.x -= 10;
        ball_mc.y -= 10;
    } else {
        ball_mc.removeEventListener(Event.ENTER_FRAME, moveBall);
    }
}