Metal Slug Game

Hey,im making a metal slug type game nd am progressing well.The problem is in metal Slug you can shoot the enemy normally but when you get close to him and press the shoot button,you can use your knife to kill the enemy.
What i need to know is how to code this in flash mx.:q: