# Looping scenes to go from first frame to last frame and rollover button play

**URL:** <https://forum.kirupa.com/t/looping-scenes-to-go-from-first-frame-to-last-frame-and-rollover-button-play/20684>\
**Category:** Uncategorized\
**Created:** [May 12, 2003, 10:07am UTC](https://forum.kirupa.com/t/looping-scenes-to-go-from-first-frame-to-last-frame-and-rollover-button-play/20684 "2003-05-12T10:07:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pez](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@pez](https://forum.kirupa.com/u/pez)\
**Post date:** [May 12, 2003, 10:07am UTC](https://forum.kirupa.com/t/looping-scenes-to-go-from-first-frame-to-last-frame-and-rollover-button-play/20684/1 "2003-05-12T10:07:40Z")

</div>

I’m trying to figure out:

a) how to loop a scene to go from the first frame to the last to the second last etc

WHILE

b) having the scene play either forwards or backwards (as above) while the user has their mouse over a button but making the scene pause when the users mouse isn’t over the button.

can anyone help me???

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 12, 2003, 10:46am UTC](https://forum.kirupa.com/t/looping-scenes-to-go-from-first-frame-to-last-frame-and-rollover-button-play/20684/2 "2003-05-12T10:46:44Z")

</div>

do you mean you want it to play backwards? Or just go to the last frame, cuz thats easy… gotoAndplay(\*);

- = scene number

Or just search the forum!  
But here…

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=21642&highlight=playing+a+movie+backwards](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=21642&highlight=playing+a+movie+backwards)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 12, 2003, 10:48am UTC](https://forum.kirupa.com/t/looping-scenes-to-go-from-first-frame-to-last-frame-and-rollover-button-play/20684/3 "2003-05-12T10:48:13Z")

</div>

hmm… not entierly sure what you want here.

am I right in thinking that you want the movie is to play start to finish when it reaches the end it plays backwards, when it reaches the start it plays forwards again and so on? But this is only to play if the user has the mouse over a button?

if this is what you want then you can do it like this:

in your button:

```auto

on(rollOver) {
      _root.Playing = true;
}

on(rollOut) {
      _root.Playing = false;
}

```

then put this code in the first frame of your \_root timeline (mx only let me know if you need a flash5 version):

```auto

Reverse = false;

this.onEnterFrame = function() {
      if(Playing) {
            if(!Reverse) {
                  gotoAndStop(_currentframe + 1);
            }else {
                  gotoAndStop(_currentframe - 1);
            }
      }
}

```

finally in the last frame of your movie put this:

```auto

Reverse = true;

```
