You probably dont want this in you enter frame or load clip events , you want to have some kind of handle collision function which is called every frame to check for collisions and react to them accordingly, this may seem like overkill if all you want to do is make a ball bounce, but it will have extensibility as well, this is how i would approach it in c++.
i used actionscript before and made something like this, basically you can make 4 wall objects and just hit test against them and change the balls direction after bounce accordingly, very nasty but also effective

an excercise once you have made your ball bounce is to then make a kind of smaller square which can be like a cage to your bouncing balls then when you click the mouse you can drag the balls into the cage and they bound off the cage instead of the overall square, good practice
This post has been edited by stayscrisp: 24 Jun, 2008 - 02:39 AM