Select a frame in the timeline while the Actions panel is open and then type/paste the code you showed into the Actions panel.
Now I have 1000 frames, I save it in an as file. I place this in the first frame. I have movie clips in Sce ne 2 & 3. I got this in output panel after publishing:
Frame.as Line 1.
ActionScript 2.0 class script may only define Class or interface constructs
What does it mean ?