Flash CS3 - movie loop - Help please!

Ok - I’ve searched high and low - and I think my biggest part is that I haven’t the slightest idea what I’m looking for.

I have a flash movie that I want to loop 3x. I tried using the code that I’ve used in previous versions of flash (I’m an AS novice), and I get the dreaded 1120 error message.

Scripting I’ve used so far:

Frame 1:
loopmax = 3;
loopcount = 0;

Last frame:
if (loopcount<loopmax) {
gotoAndPlay(2);

AND this:

for (i=1; i<11; i++){
trace (“This code is repeated ten times”);
}

TIA!
~V