FPS:hide character behind object

I wanted to ask for help on a game. It is a FPS in flash MX. I have put in trees and rocks for my characters to hide behind for just a moment(when they move by), but cannot set it so that I can’t shoot them when they are behind it. You know, when it is going behind the tree, it can’t be hit, but I cannot get that to work, any ideas?
HELP!

I hope i posted this correctly, it’s my first post and i just joined the forum group.