# Playing/rewinding in movie clip

**URL:** <https://forum.kirupa.com/t/playing-rewinding-in-movie-clip/263816>\
**Category:** Uncategorized\
**Created:** [June 19, 2008, 2:02pm UTC](https://forum.kirupa.com/t/playing-rewinding-in-movie-clip/263816 "2008-06-19T14:02:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bob\_the\_bat2](https://avatars.discourse-cdn.com/v4/letter/b/bcef8e/32.png) [@bob\_the\_bat2](https://forum.kirupa.com/u/bob_the_bat2)\
**Post date:** [June 19, 2008, 2:02pm UTC](https://forum.kirupa.com/t/playing-rewinding-in-movie-clip/263816/1 "2008-06-19T14:02:05Z")

</div>

Hi all,  
I rendered a 3d cube spinning in different directions using cinema 4d. I imported the entire sequence into flash as a movie clip. My goal is to set up buttons that will take you to certain points of the cube sequence. i.e. frame 1 scene is top of cube-the user presses a button and the cube animates to a different side-information pops up.

Basically i have 3 buttons, they all animate the cube to different sides of it. I would like to animate back to the first side of the cube if the “home” button is pressed.

im attempting to use if else and currentFrame, but im having some trouble. I also tried using prevFrame(); instances when a button is pressed but didn’t know how to stop it when the cube got to a specific side.

Below is an example of my code. if anyone has better suggestions how to do this. or know whats wrong with my code i really appreciate it. thanks.

```auto

// start buttons
stop();
work_btn.onRelease = function() {
    if (currentFrame == "start") {

        _root.cube_mc.gotoAndPlay("mainWork");
    }
    if (currentFrame == "endContact") {
        _root.cube_mc.gotoAndPlay("mainWork");
    } else {
        _root.cube_mc.gotoAndPlay("mainWork");
    }
    if (currentFrame == "profileEnd") {
        _root.cube_mc.gotoAndPlay("profile");
    } else {
        _root.cube_mc.gotoAndPlay("mainWork");
    }
};

contact_btn.onRelease = function() {
    if (currentFrame == "start") {

        _root.cube_mc.gotoAndPlay("mainContact);
    }
    if (currentFrame == "endContact") {
        _root.cube_mc.gotoAndPlay("mainWork");
    } else {
        _root.cube_mc.gotoAndPlay("mainWork");
    }
    if (currentFrame == "profileEnd") {
        _root.cube_mc.gotoAndPlay("profile");
    } else {
        _root.cube_mc.gotoAndPlay("mainWork");
    }
};

profile_btn.onRelease = function() {
    if (currentFrame == "start") {

        _root.cube_mc.gotoAndPlay("mainProfile);
    }
    if (currentFrame == "endContact") {
        _root.cube_mc.gotoAndPlay("mainWork");
    } else {
        _root.cube_mc.gotoAndPlay("mainWork");
    }
    if (currentFrame == "profileEnd") {
        _root.cube_mc.gotoAndPlay("profile");
    } else {
        _root.cube_mc.gotoAndPlay("mainWork");
    }
};

```

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 19, 2008, 2:27pm UTC](https://forum.kirupa.com/t/playing-rewinding-in-movie-clip/263816/2 "2008-06-19T14:27:56Z")

</div>

you could do this with papervision, if you could get the as2 white shark version and follow the tut in my sig

else

I guess you would have to check which frame you are on and rewind until that point.

---

<div class="post-metadata">

**Author:** ![bob\_the\_bat2](https://avatars.discourse-cdn.com/v4/letter/b/bcef8e/32.png) [@bob\_the\_bat2](https://forum.kirupa.com/u/bob_the_bat2)\
**Post date:** [June 19, 2008, 3:00pm UTC](https://forum.kirupa.com/t/playing-rewinding-in-movie-clip/263816/3 "2008-06-19T15:00:40Z")

</div>

" I guess you would have to check which frame you are on and rewind until that point."

thats what im thinking, but i think my code is wrong to check the currentFrame. Everytime i try to trace the currentFrame it doesn’t come up. Should i be using something else to locate the currentFrame? getProperty perhaps?

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [June 19, 2008, 3:30pm UTC](https://forum.kirupa.com/t/playing-rewinding-in-movie-clip/263816/4 "2008-06-19T15:30:54Z")

</div>

I think I need to see an fla, its bit too much to ask
