# Rewind button

**URL:** https://forum.kirupa.com/t/rewind-button/315153
**Category:** Uncategorized
**Created:** [October 19, 2010, 4:27am UTC](https://forum.kirupa.com/t/rewind-button/315153 "2010-10-19T04:27:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ludaisakson](https://avatars.discourse-cdn.com/v4/letter/l/e274bd/32.png) [@ludaisakson](https://forum.kirupa.com/u/ludaisakson)
#### Post date: [October 19, 2010, 4:27am UTC](https://forum.kirupa.com/t/rewind-button/315153/1 "2010-10-19T04:27:00Z")

</div>

can anyone tell me what’s wrong with my code? (i’m really new to flash and actionscript3).

```auto

forward_btn.addEventListener(MouseEvent.CLICK, forwardfunction);

function forwardfunction(event:MouseEvent):void
{
    port_mc.play();

}

pause_btn.addEventListener(MouseEvent.CLICK, pausefunction);

function pausefunction(event:MouseEvent):void
{
    port_mc.stop();
    
}

rewind_btn.addEventListener(MouseEvent.CLICK, myfunction);
function myfunction(event:MouseEvent):void
{
    addEventListener(Event.ENTER_FRAME, rewindfunction);
    function rewindfunction(event:Event):void
    {
        port_mc.prevFrame();
    }
}

```

I have a strip of pictures that moves from left to right when user clicks “forward” button, pauses when the “pause” button is clicked and rewinds when “rewind” button is clicked.  
My problem is that after rewind cycle is complete, none of the buttons work again. Also, while in rewind mode, pause button does not pause it.  
I also had if and else statements for rewindfunction as

```auto

if (port_mc.currentFrame == 1)
      {
       port_mc.stop();
      }
      else
      {
       port_mc.prevFrame();
    
      }

```

but it really seemed to have no difference on how it works.
