# AS3 Problem with MC as button

**URL:** <https://forum.kirupa.com/t/as3-problem-with-mc-as-button/329330>\
**Category:** flash\
**Created:** [August 14, 2012, 6:28pm UTC](https://forum.kirupa.com/t/as3-problem-with-mc-as-button/329330 "2012-08-14T18:28:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dominik\_Ryfa](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@Dominik\_Ryfa](https://forum.kirupa.com/u/Dominik_Ryfa)\
**Post date:** [August 14, 2012, 6:28pm UTC](https://forum.kirupa.com/t/as3-problem-with-mc-as-button/329330/1 "2012-08-14T18:28:34Z")

</div>

Hello. I am new here.

I have small problem with MC in AS3.

I would like to make a movie clip, that works like that:

When u press it first time, it goes to current frame and play.  
When u press it second time, it goes to other frame

I tried to do this that way:

z1.addEventListener(Event.ENTER\_FRAME, everyFrame);

z2.addEventListener(MouseEvent.CLICK, nacisk1);

function nacisk1(event:MouseEvent):void {  
z2.gotoAndPlay(2);

```
else

```

{  
gotoAndPlay(20);  
}

but it does not work.

z1 is a current MC.

Thanks for help
