Game in ActionScript

I am attaching a simple action script
my question is when i press a button the ball goes up and after a certain distance it come back
i hav used hittest but i need to know how to control the ball

for example when the ball is mooving up and hittest occurs i want the ball to come down to its initial position from where it started

but if hittest occurs when the ball is comming down i want hittest to occur

but i am finding it difficult pls help me out

regards
prasanth

waiting for ur valuable reply at the earliest