How to insert recording function in a Flash piano

Hy guys, i’m trying to create a Flash piano application. I’m a beginner and i’m using Adobe Flash CS5. The first part of my piano is ultimated, infact i created all keys and each of them works fine. Now i wanna insert a recording function, so that when you click on the recording button you can store the composed melody. I need obviously to insert Stop and Play function, to stop recording and listening the music. How can i do that? Which types of codes i need to study? Remember that i’m a beginner so please, i need a specific guide if you can. Thanks.

When you start recording, store the time to a variable. On each further keypress store the value of which key was pressed, and the time relative to the start time into an array. This can be used to playback the notes with the same order and timing.

Thank you very much for reply. But as i said i’m a beginner, i just want to know which things i have to study to do what you wrote, so i’ll read tutorials and i’ll try this. Thanks.