You know what? The thing you should do is to go over the AS: Main tutorials and study coding yourself.
ALL codes given to DOES work, but because you're only copy pasting the code, it WON'T work. I'm all for helping newbies out, but you're just gonna feed him the code without letting him learn how it works, he'll forever rely on others for copy paste. It also doesn't help that you're starting to sound arrogant when you said "You should fix the code a bit or try another one so I'll come and try again.". It's like telling someone to do your work for you (well, it actually is).
I'll link you to the basics. Read it, understand it and master it. You will not make games without learning how to make them.
AS: Beginning ActionScript (extreme basics)
http://www.newgrounds.com/bbs/topic/3543 98
AS: Basic Collision Detection
http://www.newgrounds.com/bbs/topic/2967 55
AS: If-else conditionals
http://www.newgrounds.com/bbs/topic/2966 99
Those are basic things that every scripter knows. From those, you can do do what you want.
Hint -- what you want to do can be accomplished in 5 minutes or less. It's real basic.