Prototype problem w/flash5 but ok w/flash6

I’m still working on my scrolling product bar, and it works great when I publish in flash 6 or higher, but prototype does not work when I publish for flash 5.

MovieClip.prototype.easeTo = function(x) {     
		if (x != this._x) {
                _root.isSliding = 1;
                this.onEnterFrame = function() {
                        //this would be used to ease x position
                        this._x = x-(x-this._x)/1.2;
                        if (this._x<x+1 && this._x>x-1) {
                                _root.isSliding = 0;
		      if(mainmenu._x > 255 && mainmenu._x < 295){
			mainmenu._x = mainmenu._x -821;
		      }								      else if(mainmenu._x < -930 && mainmenu._x > -985){
		      	mainmenu._x = mainmenu._x + 821;
		      };
	           texta.text = mainmenu._x;
                        delete this.onEnterFrame;
                        }
                };
        }
};

The movieclip mainmenu is sitting on the root and this prototype is in my first frame. Can anyone see why it’s not moving the mainmenu mc? This is the line I use to call the prototype:

 mainmenu.easeTo(mainmenu._x+137.7);

Any help would be appreciated.

*Woops … wrong subject :trout:

because there is no onEnterFrame in Flash 5. To emulate that, you’ll need to place this on the movieclip;

onClipEvent(enterFrame){
    this.onEnterFrame();
}

Crap, I thought that did the trick but it only worked for one instance of clicking the button. Could this be because I have a stop action on my second frame to stop the playhead from running to the second scene?

I’ve attached the file if anyone is willing to take a look. Thanks.

Well my research tells me that stopping the playhead shouldn’t affect the code that Senocular gave me. Still can’t get it to work, if someone could look at the fla I’d really appreciate the help.

one thing you may need to watch for (and I havent looked at your code really so Im not sure if its affected or not) is that in Flash 5, property references didn’t need this to specify scope in methods… I cover this alittle in the FAQ here:

http://proto.layer51.com (under something like why wont proto work or something)

basically its just weird referencing issues that haven’t been ironed out in 5. You may need to handle variables a little differently is all.