[F5] 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.