# Button movies

**URL:** https://forum.kirupa.com/t/button-movies/866
**Category:** Uncategorized
**Created:** [August 1, 2002, 2:56am UTC](https://forum.kirupa.com/t/button-movies/866 "2002-08-01T02:56:11Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![shuga](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@shuga](https://forum.kirupa.com/u/shuga)
#### Post date: [August 1, 2002, 2:56am UTC](https://forum.kirupa.com/t/button-movies/866/1 "2002-08-01T02:56:11Z")

</div>

i’ve seen this done on a lot of sites [http://www.methodengine.com/V1/index\_set.html](http://www.methodengine.com/V1/index_set.html) is just one example. when you rollOver the button the movie plays forward then when you roll off it plays backwards now this is easy to do if the user stays in the rollOver state for the duration of the animation but if you rollOut in the middle of the animation it would jump. this movie doesnt … it plays from the exact same spot almost like they tell the movie to play backwards from the frame it is on when the rollOut action occurs. how do they do that?

thx

---

<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: [August 1, 2002, 8:13am UTC](https://forum.kirupa.com/t/button-movies/866/2 "2002-08-01T08:13:49Z")

</div>

Wow! That’s fantastic… I really have to learn how to use video in MX. And buy a camera ☹

Anyway, the function you’re looking for is prevFrame(). All you have to do is put an empty movie clip that will

```auto
onClipEvent (enterFrame) {if (backwards) _root.yourClip.prevFrame();}

```

and handle the backwards variable from your button (on rollOver=1, on rollOut=0).

I hope it makes sense.

pom :asian:

---

<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: [August 1, 2002, 3:07pm UTC](https://forum.kirupa.com/t/button-movies/866/3 "2002-08-01T15:07:24Z")

</div>

right … i understand how to give it a rollOver and rollOut action but i dont understand how to write the (backwards) function. does flash have a function like this?

i’m sorry to be a newb but i really don’t understand how they make the movie seem to play backwards from whatever spot you perform the rollOut action.

---

<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: [August 1, 2002, 4:06pm UTC](https://forum.kirupa.com/t/button-movies/866/4 "2002-08-01T16:06:27Z")

</div>

Oh, no, backwards is not a function, it’s just a variable name =1 or 0. The function you need is prevFrame()

I made an example.

pom :asian:

---

<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: [August 1, 2002, 4:07pm UTC](https://forum.kirupa.com/t/button-movies/866/5 "2002-08-01T16:07:12Z")

</div>

That’s a great effect: make a tutorial! 🙂

pom :asian:

---

<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: [August 1, 2002, 4:55pm UTC](https://forum.kirupa.com/t/button-movies/866/6 "2002-08-01T16:55:19Z")

</div>

:-\ stupid work hasn’t gotten through the 8 year approval process it takes to get new software around here … they gotta make sure flash mx isnt going to break their p.o.s. machines. long story short - i dont have flash mx at work yet. we have flash 5 … so unless you can repost a flash 5 version of that example im going to have to wait 'till tonight when i get home to open it.

thx for the help though … i’m excited to see it.

---

<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: [August 1, 2002, 7:15pm UTC](https://forum.kirupa.com/t/button-movies/866/7 "2002-08-01T19:15:24Z")

</div>

Oh man… am I going to have to go out and buy Flix? Too many products!!! I just can’t afford them all. ☹

---

<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: [August 2, 2002, 3:33am UTC](https://forum.kirupa.com/t/button-movies/866/8 "2002-08-02T03:33:37Z")

</div>

Is that done with Flix?

pom :asian:

---

<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: [August 2, 2002, 4:30am UTC](https://forum.kirupa.com/t/button-movies/866/9 "2002-08-02T04:30:05Z")

</div>

Hey, Pom… can you translate? I mean… I know what you’re saying here… but how does it translate…

onClipEvent (enterFrame){  
if (\_root.i) \_root.prevFrame();  
else \_root.nextFrame();  
}

why do we need the empty movie clip? (not doubting your code at all…)

is this the same as:

onClipEvent(enterFrame){  
if(\_root.i==0){  
\_root.prevFrame();  
}else{  
\_root.nextFrame();  
}  
}

is that right?

Again, I’m really trying to understand from an a/s perspective. Not knocking your code at all! We’re buds! Right?

---

<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: [August 2, 2002, 4:58am UTC](https://forum.kirupa.com/t/button-movies/866/10 "2002-08-02T04:58:48Z")

</div>

Inigo, Inigo… 😛 If you only read what I’ve been writing with my poor tired hands… [http://www.kirupa.com/developer/actionscript/as\_tricks.asp](http://www.kirupa.com/developer/actionscript/as_tricks.asp)  
It’s in the simple if…else section.

But basically, it’s what you said. Well, the opposite in fact 🙂

pom :asian:
