# Scroller buttons

**URL:** https://forum.kirupa.com/t/scroller-buttons/57111
**Category:** flash
**Created:** [July 10, 2004, 10:22am UTC](https://forum.kirupa.com/t/scroller-buttons/57111 "2004-07-10T10:22:24Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Mango](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@Mango](https://forum.kirupa.com/u/Mango)
#### Post date: [July 10, 2004, 10:22am UTC](https://forum.kirupa.com/t/scroller-buttons/57111/1 "2004-07-10T10:22:24Z")

</div>

I just wanted to know how to make content in a dynamic text box scroll continuously, right now you can only click on the up to move it up a bit, and down to move it down a bit etc. I want the user to be able to hold down the button to make the content scroll. Could anyone help me with this please?  
Thanks in advance!

the code on the up button:

```auto
on (release) {
	contentArea.scroll-=1;
}

```

the code on the down button:

```auto
on (release) {
 contentArea.scroll += 1;
}

```

contentArea is the instance name of my dynamic text box. 🙂

---

<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: [July 10, 2004, 11:29am UTC](https://forum.kirupa.com/t/scroller-buttons/57111/2 "2004-07-10T11:29:30Z")

</div>

if you make the scroll buttons into to MCs…this will work:

up button:

```auto

on (press) {
	this.onEnterFrame = function() {
		_root.contentText.scroll -= 1;
		
	};
}
on (release) {
	delete this.onEnterFrame;
}

```

down button:

```auto

on (press) {
	this.onEnterFrame = function() {
		_root.contentText.scroll += 1;
		
	};
}
on (release) {
	delete this.onEnterFrame;
}

```

---

<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: [July 11, 2004, 4:57pm UTC](https://forum.kirupa.com/t/scroller-buttons/57111/3 "2004-07-11T16:57:40Z")

</div>

Thanks.  
Are you meant to put the actionscript code in the movie clip itself?  
I just tried it and it doesn’t seem to work at 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: [July 12, 2004, 3:46pm UTC](https://forum.kirupa.com/t/scroller-buttons/57111/4 "2004-07-12T15:46:05Z")

</div>

Make each scroll button its own movieclip and put the code **on** the actual movie clips, not the timeline.

---

<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: [July 12, 2004, 8:27pm UTC](https://forum.kirupa.com/t/scroller-buttons/57111/5 "2004-07-12T20:27:03Z")

</div>

Hmm I just tried that too and it doesnt work. maybe something is missing? do i have to get rid of my old actionscript coding as well? cos i tried with and without but it still doesn’t work

---

<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: [July 14, 2004, 10:25am UTC](https://forum.kirupa.com/t/scroller-buttons/57111/6 "2004-07-14T10:25:44Z")

</div>

_bump_ (sorry for bumping my post… just that i really need some help here!!)

---

<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: [July 14, 2004, 12:18pm UTC](https://forum.kirupa.com/t/scroller-buttons/57111/7 "2004-07-14T12:18:22Z")

</div>

try this, it’s better anyways, you can adjust the speed of scroll independent of the FPS speed:

---

<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: [July 14, 2004, 12:30pm UTC](https://forum.kirupa.com/t/scroller-buttons/57111/8 "2004-07-14T12:30:18Z")

</div>

Turn your button into a movieClip and apply the folloing code:

```auto
onClipEvent(enterFrame){
this.scroll -=1;
}

```

Then +=1; for the other button.

Regards,

---

<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: [July 14, 2004, 12:36pm UTC](https://forum.kirupa.com/t/scroller-buttons/57111/9 "2004-07-14T12:36:40Z")

</div>

fraggs, that wouldn’t target the text…that ‘this’ would target the MC button its self, even if you did target the text, that would scroll infinitely with no relent, with pressing anything at that… :h:

---

<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: [July 14, 2004, 1:40pm UTC](https://forum.kirupa.com/t/scroller-buttons/57111/10 "2004-07-14T13:40:55Z")

</div>

Macneilslt, thanks! I looked at your .fla file and changed mine in the same way, and now it finally works, yay 🙂  
Thanks to everyone as well for your help 🙂
