# Problem with 2 state movie clip

**URL:** <https://forum.kirupa.com/t/problem-with-2-state-movie-clip/260055>\
**Category:** Uncategorized\
**Created:** [May 12, 2008, 8:35am UTC](https://forum.kirupa.com/t/problem-with-2-state-movie-clip/260055 "2008-05-12T08:35:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alber\_Kidd](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@Alber\_Kidd](https://forum.kirupa.com/u/Alber_Kidd)\
**Post date:** [May 12, 2008, 8:35am UTC](https://forum.kirupa.com/t/problem-with-2-state-movie-clip/260055/1 "2008-05-12T08:35:21Z")

</div>

I have a movie clip that is an ‘about’ button. It has 2 frames one for each state(see gif). The problem is I have added the following code to the rollover (blue box). It traces the message but does not move the timeline. Any reason why the this keyword should not work here?

inv2.addEventListener(MouseEvent.MOUSE\_OVER, goBack);

function goBack(event:MouseEvent) {  
trace(‘yo’);  
this.gotoAndStop(1);

}

---

<div class="post-metadata">

**Author:** ![Alber\_Kidd](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@Alber\_Kidd](https://forum.kirupa.com/u/Alber_Kidd)\
**Post date:** [May 12, 2008, 11:32am UTC](https://forum.kirupa.com/t/problem-with-2-state-movie-clip/260055/2 "2008-05-12T11:32:12Z")

</div>

thanks, this object is not created with a class it is a frame tweened menu with lots of buttons inside it.

is there any way to do it from an inner function?

I have tried

gotoAndStop(1);

this.gotoAndStop(1);

When I trace(this) I get

[object about]

There must be a way to make the current movieclips timeline go to frame 1?

---

<div class="post-metadata">

**Author:** ![Alber\_Kidd](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@Alber\_Kidd](https://forum.kirupa.com/u/Alber_Kidd)\
**Post date:** [May 12, 2008, 11:49am UTC](https://forum.kirupa.com/t/problem-with-2-state-movie-clip/260055/3 "2008-05-12T11:49:00Z")

</div>

> [@amarghosh;2324988](#):
>
> give a trace(this.currentFrame) before and after the gotoAndStop line and see what u get;

I get the correct frame

this code

inv3\_mc.addEventListener(MouseEvent.MOUSE\_OVER, goBack);

function goBack(event:MouseEvent) {  
trace(this.currentFrame);  
trace(this);  
gotoAndStop(1);  
trace(this.currentFrame);

}

outputs…

2  
[object about]  
1

so why us the timeline not moving?

Thanks.

---

<div class="post-metadata">

**Author:** ![Alber\_Kidd](https://avatars.discourse-cdn.com/v4/letter/a/e47c2d/32.png) [@Alber\_Kidd](https://forum.kirupa.com/u/Alber_Kidd)\
**Post date:** [May 12, 2008, 12:33pm UTC](https://forum.kirupa.com/t/problem-with-2-state-movie-clip/260055/4 "2008-05-12T12:33:54Z")

</div>

attached is the flash source. Please can you take a quick look. Thanks.
