i was looking around myself during computer science last semester for how to write a randomly generated number from a certain range, its a good tool =/
floored means Math.floor(), its one of the built in math functions that will round a number DOWN.
try using new if statements for the movement, else if statements just cancel everything else, so if i hold all the keys its easy to see you have
if(Key.isDown(Key.LEFT)){
box._x -= 5;
}
if(Key.isDown(Key.RIGHT)){
box._x += 5;
}
and the same thing with up and down for the y values?... just take else the else ifs XD
(this is AS2.0 incase you use AS3.0)