# Prototype problem w/flash5 but ok w/flash6

**URL:** <https://forum.kirupa.com/t/prototype-problem-w-flash5-but-ok-w-flash6/120344>\
**Category:** Uncategorized\
**Created:** [August 23, 2004, 2:51pm UTC](https://forum.kirupa.com/t/prototype-problem-w-flash5-but-ok-w-flash6/120344 "2004-08-23T14:51:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JustinM](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@JustinM](https://forum.kirupa.com/u/JustinM)\
**Post date:** [August 23, 2004, 2:51pm UTC](https://forum.kirupa.com/t/prototype-problem-w-flash5-but-ok-w-flash6/120344/1 "2004-08-23T14:51:55Z")

</div>

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.

```auto
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:

```auto
 mainmenu.easeTo(mainmenu._x+137.7);

```

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![Voetsjoeba](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@Voetsjoeba](https://forum.kirupa.com/u/Voetsjoeba)\
**Post date:** [August 23, 2004, 2:55pm UTC](https://forum.kirupa.com/t/prototype-problem-w-flash5-but-ok-w-flash6/120344/2 "2004-08-23T14:55:05Z")

</div>

\*Woops … wrong subject :trout:

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [August 23, 2004, 2:56pm UTC](https://forum.kirupa.com/t/prototype-problem-w-flash5-but-ok-w-flash6/120344/3 "2004-08-23T14:56:18Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![JustinM](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@JustinM](https://forum.kirupa.com/u/JustinM)\
**Post date:** [August 23, 2004, 3:03pm UTC](https://forum.kirupa.com/t/prototype-problem-w-flash5-but-ok-w-flash6/120344/4 "2004-08-23T15:03:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JustinM](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@JustinM](https://forum.kirupa.com/u/JustinM)\
**Post date:** [August 24, 2004, 12:47pm UTC](https://forum.kirupa.com/t/prototype-problem-w-flash5-but-ok-w-flash6/120344/5 "2004-08-24T12:47:28Z")

</div>

> [@JustinM](#):
>
> Could this be because I have a stop action on my second frame to stop the playhead from running to the second scene?

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.

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [August 24, 2004, 1:21pm UTC](https://forum.kirupa.com/t/prototype-problem-w-flash5-but-ok-w-flash6/120344/6 "2004-08-24T13:21:08Z")

</div>

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](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.
