Flash CS3 AS 2.0 Syntax error

Hi there,

I’m pretty new to Flash and my first project is my own on-line portfolio. I found (what I think is a Flash 5) code on this board to create an infinite menu. I’m trying to tweak it so that it works in AS 2.0 for CS3 and I keep getting a syntax error. Can anyone help me?

Here’s the code:

menu.loadClip()
{
xcenter=150;
speed=1/10;
}
menu.onEnterFrame() {
var distance=_root._xmouse-xcenter;
_x+=(distance*speed);
if (_x > 0) _x=-300;
if (_x < -300) _x=0;
}

The syntax error seems to be with the [COLOR=“Blue”]menu.onEnterFrame() {[/COLOR] line.