Button triggered object movement

alright i know i can tell a target to change it’s position on(press) of a button.

i would like to rewrite


on(mouseOver){
box._x+5;
}

so that you don’t have to keep putting the mouse on and off the button but you can just leave the mouse over the button and the object will move

i’m sure it’s a simple solution i’m just not thinking of at the moment, your help is greatly appreciated

thx

on(rollOver){
if (!box.onEnterFrame) box.onEnterFrame = function(){this._x+=5;}
}

on(rollOut){
if (box.onEnterFrame) delete box.onEnterFrame;
}

your script produces these errors

Scene=main, Layer=buttons, Frame=1: Line 1: Invalid mouse event specified.
on(mouseOver){

Scene=main, Layer=buttons, Frame=1: Line 2: Statement must appear within on handler
if (!map.onEnterFrame) map.onEnterFrame = function(){this._x-=5;}

Scene=main, Layer=buttons, Frame=1: Line 3: Unexpected ‘}’ encountered
}

please help

lol sorry

on(rollOver){
if (!box.onEnterFrame) box.onEnterFrame = function(){this._x+=5;}
}

on(rollOut){
if (box.onEnterFrame) delete box.onEnterFrame;
}

thank you very much =)