Game programming - Help plz

Hi everyone i’m doing a game for a project in school and it’s a mix with dancemania and typing of the dead.

The thing i need help with in AS3 is:

There’s the main character, and when it comes with contact with the enemy it shows the keys to defeat him. I want to know how to program it: so when i hit the first key right, it goes to the second key, and if i fail one of them 1 lose life.

I hope i explained it well, and if you can help me i appreciate it :slight_smile: