Simplest wall for your falling ball:
You probably have an event that runs every frame, or some code that repeats at the frame rate. This code changes the x and y position of an object, right?
So you have velocity and position.
Now, since this routine runs every time the ball moves, you can check to see where it was, and where it'll move to, correct?
So, you have the final position of the moving routine.
Now, let's pretend the "ground" is a line across the bottom of the screen. In Flash, the top has a y value of 0, the bottom has a y value equal to the stage height. So, let's say the "ground" is 25 pixels above the bottom of the screen. If you're using the default stage size, that'd be 550-25, which is 525. Now we have a maximum possibly y value.
So, you have where the ball came from, where it ended, and the furthest it can go before doing something different than falling. Here's an example of how that can be applied (pseudo code):
First, initalize some variables once.
y velocity = 0
gravity = 0.5
bounce factor = 0.9
ground = 525
Next, we have the routine that'll run at the frame rate.
y += y velocity
y velocity += gravity <--that's where you stop if it just falls. Now let's test the ground.
if (y >= ground){ <--simple if statement. Will run the logic inside the {} if the condition is true
y = ground <-- the ball may sometimes pass beyond the ground if the increment is too large. This will remove that error
y velocity = -y velocity * bounce factor <--simple bounce logic. The velocity will change direction after the collision, but at a smaller value. That's where the bounce comes in.
}
And that'll make a 'wall' at y = 525.
You can replace the hard-coded number with any method of detecting a collision.