# rollOver prevFrame

**URL:** https://forum.kirupa.com/t/rollover-prevframe/11473
**Category:** flash
**Created:** [January 17, 2003, 5:49pm UTC](https://forum.kirupa.com/t/rollover-prevframe/11473 "2003-01-17T17:49:25Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![superdude](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@superdude](https://forum.kirupa.com/u/superdude)
#### Post date: [January 17, 2003, 5:49pm UTC](https://forum.kirupa.com/t/rollover-prevframe/11473/1 "2003-01-17T17:49:25Z")

</div>

Hi, i’d like to scroll my movie back one frame on and on when the  
mouse is over a button and stop only on mouseout. How can i achieve it?

This code:

on (rollOver) {  
prevFrame();  
}  
on (rollOut) {  
stop();  
}

only moves back one frame and stops.

Thanks

Al

---

<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: [January 17, 2003, 5:56pm UTC](https://forum.kirupa.com/t/rollover-prevframe/11473/2 "2003-01-17T17:56:31Z")

</div>

[http://www.kirupaforum.com/showthread.php?s=&threadid=11427](http://www.kirupaforum.com/showthread.php?s=&threadid=11427)

---

<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: [January 17, 2003, 6:14pm UTC](https://forum.kirupa.com/t/rollover-prevframe/11473/3 "2003-01-17T18:14:26Z")

</div>

> \*Originally posted by senocular \*  
> \*\*[http://www.kirupaforum.com/showthread.php?s=&threadid=11427](http://www.kirupaforum.com/showthread.php?s=&threadid=11427) \*\*

Is there any other simpler way to do it?

i’ve used

on (rollOver) {  
play();  
}  
on (rollOut) {  
stop();  
}

for the fwd motion, can anything similar be done for the backwards motion?

---

<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: [January 17, 2003, 7:08pm UTC](https://forum.kirupa.com/t/rollover-prevframe/11473/4 "2003-01-17T19:08:31Z")

</div>

It doesn’t get any easier than what is in that thread.

Did you read page 3 in there? That is where the code is for what you are looking for (4th post from the bottom I believe).

---

<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: [January 17, 2003, 7:09pm UTC](https://forum.kirupa.com/t/rollover-prevframe/11473/5 "2003-01-17T19:09:11Z")

</div>

You can also use hittest as an alternative, I also find it to be more sensitive to the mouse compared to using rollOvers. You can use a script like this:

```php
 onClipEvent (enterFrame) {
	if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
	_root.nextFrame();
 } else {
	_root.prevFrame();
 }
}

```

I also attached a sample file for you to see how this all works.

---

<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: [January 17, 2003, 7:23pm UTC](https://forum.kirupa.com/t/rollover-prevframe/11473/6 "2003-01-17T19:23:43Z")

</div>

> \*Originally posted by electrongeek \*  
> \*\*I also attached a sample file for you to see how this all works. \*\*

Thanks will give it a go

---

<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: [January 18, 2003, 10:11am UTC](https://forum.kirupa.com/t/rollover-prevframe/11473/7 "2003-01-18T10:11:05Z")

</div>

I was hoping there was a method without the use of MC.  
The reason being i’ve created a historical timeline with no use of MC - probably not the best approach, in fact i am also wondering if anybody can shed some light on the best way to create one.

I’ve achieved the same effects as

[http://www.pbs.org/wgbh/amex/telephone/timeline/f\_timeline.html](http://www.pbs.org/wgbh/amex/telephone/timeline/f_timeline.html)

by dividing the whole timeline into 32 chunks. Starting with the first keyframe i added the first chunk, then the second keyframe the 1st chunk slides from right to left and the gap caused by this movement is filled with the second chunk, and so on. The timeline effect is definitely there, and the buttons i use to go back and fwd work as they should by using

```php
 on (release) { 
   nextFrame(); 
} 

```

and

```php
 on (release) { 
   prevFrame(); 
} 

```

the problem appears when using invisible buttons on the timeline itself. It does work fine on the fwd effect as i am using

```php
on (rollOver) { 
    play(); 
} 
on (rollOut) { 
   stop(); 
} 

```

but i find no way to use the same feature to go back …

Can anybody help, even it means recreating the timeline altogether?

Thanx

---

<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: [January 18, 2003, 11:01am UTC](https://forum.kirupa.com/t/rollover-prevframe/11473/8 "2003-01-18T11:01:35Z")

</div>

i think i may have found a way…

```php
on (rollOver) {
    this.onEnterFrame = function() {
        prevFrame();
    }
}

on (rollOut) {
    this.onEnterFrame = null;
}

```

---

<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: [January 18, 2003, 6:53pm UTC](https://forum.kirupa.com/t/rollover-prevframe/11473/9 "2003-01-18T18:53:07Z")

</div>

That is almost like the code I used in the forwards backwards thread, except I didn’t null the onEnterFrame, I deleted it.

```auto
on (rollOver) {
    this.onEnterFrame = function() {
        prevFrame();
    }
}

on (rollOut) {
    delete this.onEnterFrame
}

```
