KeyBoard Controls

Am Creating A game Using Action Script 2.0.The objects By KeyBoard Controls When I Moves It goes To Endless of screen How Can I Use IT in Particular Screen Width And Height