You make a button.Write as Instance name:"button"
You atach this code to it:
on (release) {
_root.button._x = random(500);
_root.button._y = random(500);
}
STEP2
You refer to the object(button)using the absolute method.
then you set random to choose numbers between 0 and the number you
want(500 in this case.)You this to the x and y axis and its done.:)
hope you find this usefull