Photo Gallery Issues

Hi,
I am following instructions at the following web page to try to create my first Flash Photo Gallery in MX, here is the link:
http://www.kirupa.com/developer/mx/photogallery.htm

I am a bit cornfused as to how to paste the code provided into an empty keyframe within Flash MX. I have successfully edited the code but when selecting an empty keyframe on a new layer I go to Edit and paste (the copied code) and it pastes it onto the main stage area which runs way off the stage area.

Since I am a novice with this I am not sure what to do from here!?! Any help would be a real blessing. Thanks so much in advance.