# Up&Down MC scroll buttons

**URL:** https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873
**Category:** flash
**Created:** [April 10, 2003, 5:41am UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873 "2003-04-10T05:41:17Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![sintax321](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@sintax321](https://forum.kirupa.com/u/sintax321)
#### Post date: [April 10, 2003, 5:41am UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/1 "2003-04-10T05:41:17Z")

</div>

Ok i searched the board and couldn’t find any threads on this. I need a set of buttons that will scroll a MC up and down when the mouse is clicked and held like a normal scroll button. The only MC scrolling tuts i can find use a drag bar, this is not an option. Any body know how to code this?

---

<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: [April 10, 2003, 6:21am UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/2 "2003-04-10T06:21:47Z")

</div>

ok what i do in this case is make a mask over the mc and have a mc as a btn that controls the \_y pos of the movie clip on a press event it doesnt have a scroller because i havent tried doing it that way

---

<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: [April 10, 2003, 6:29am UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/3 "2003-04-10T06:29:00Z")

</div>

Ok, I will give this a quick shot, untested, but should work.

Create the scrolling movie clip symbol. Hmm, call it “myClip” I guess (for this situation I will use that instance name).

Now I used movie clips for buttons for this (well… in my head) so I don’t think regular button symbols will work for this.

So create your movie symbol buttons. Give one the instance name of “up” and the other the instance name of “down”

Now on a frame apply these actions…

[AS]var speed = 5;  
var howFarUp = 0;  
var howFarDown = 150;  
function moveUp() {  
this.onEnterFrame = function() {  
myClip.\_y -= speed;  
if (myClip.\_y\<=howFarUp) {  
delete this.onEnterFrame;  
}  
};  
}  
function moveDown() {  
this.onEnterFrame = function() {  
myClip.\_y += speed;  
if (myClip.\_y\>=howFarDown) {  
delete this.onEnterFrame;  
}  
};  
}  
function clearEnterFrame() {  
delete this.onEnterFrame;  
}  
up.onPress = moveUp;  
up.onRelease = clearEnterFrame;  
down.onPress = moveDown;  
down.onRelease = clearenterFrame;[/AS]

speed is how fast you want the scroll  
howFarUp is the \_y coordinate that the clip can scroll UP to (using the up button)  
howFarDown is the \_y coordinate the clip can scroll DOWN to (using the down button)

---

<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: [April 10, 2003, 6:31am UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/4 "2003-04-10T06:31:12Z")

</div>

Huge man huge. I will get to testing this right away. i have to get u a gift or something. You always show me the way to go. Thanks LIB

---

<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: [April 10, 2003, 6:32am UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/5 "2003-04-10T06:32:25Z")

</div>

No problem, I wouldn’t be surprised if I screwed something up with that. Thinking out an entire code in my head at 2:30am is never good 😛

But it shouldn’t be too hard to fix if there is something wrong :-\ I hope 😛

Goodluck, and Goodnight 🙂

---

<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: [April 10, 2003, 6:41am UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/6 "2003-04-10T06:41:12Z")

</div>

oh man lost!

this is just incredible. I tested it myself and it 100% works! I’ve  
also been wanting this sort of thing with no luck…until now!

Man-oh-man this is SO HUGE, you have no idea. You are def THE MAN! :beam:

nice work as usual.

---

<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: [April 10, 2003, 6:42am UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/7 "2003-04-10T06:42:49Z")

</div>

Huge man so Huge. My new site has a tut section and i would love to add this to it with your help. YOu would be full ycredited of course and a like to your site would be beside 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: [April 10, 2003, 4:40pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/8 "2003-04-10T16:40:37Z")

</div>

Hmm, interesting. I tested it just now… and my scrolling seems backwards 😛 Up scrolls down and Down scrolls up…hahahaha.

Alright… well I did another quick scroller thing again. This time you can use it on either MovieClip buttons OR Button symbols 🙂

And it scrolls in the right direction. And it fixes the bug in my last script where when it reached the howFarUp or howFarDown if you kept clicking the button it would still keep moving pixel by pixel 😛

Check my attachment for my fully commented .fla file 🙂

---

<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: [April 10, 2003, 5:22pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/9 "2003-04-10T17:22:19Z")

</div>

unbelievable lost. i’m stunned at you, as always. :beam:

---

<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: [April 10, 2003, 6:10pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/10 "2003-04-10T18:10:34Z")

</div>

Amazing man. you are the best:)

---

<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: [April 10, 2003, 8:00pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/11 "2003-04-10T20:00:44Z")

</div>

Glad you guys like 🙂

---

<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: [April 11, 2003, 2:35am UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/12 "2003-04-11T02:35:55Z")

</div>

WHOA!!! WHAT THE $#&^… Im not a pixel person? How the heck could that have happened? Im a mod, Im a member, I contribute… (Waaaaaaaaaaaaaaaaaaaaaaaaahhaha…BOOOOOOOoo)\<SOB\>  
☹

---

<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: [April 11, 2003, 3:39am UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/13 "2003-04-11T03:39:30Z")

</div>

Montoya: We all made our own Pixel People 😛

---

<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: [April 11, 2003, 3:57am UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/14 "2003-04-11T03:57:54Z")

</div>

c’mon man, let me have a little phun with this! I’ve never made a pixel person before. How’d you do that?

Lost… you’re not as cheerie as I remember you. Whassup brotha?

---

<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: [April 11, 2003, 4:03am UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/15 "2003-04-11T04:03:55Z")

</div>

Hmm, is it really that noticeable ☹ Hrmm… I guess I hide it better in real life :-\ :\*( Just got a lot goin’ on here.

As for making pixel people. I used Photoshop, just goto Window/Document/New Window to create two windows of the same document. In one window zoom ALL the way in… then take the 1px pencil tool and start clicking pixel by pixel to create your pixel person 🙂 You will be able to refer back to your normal sized window on what it looks like instead of zooming in and out all the time.

You can submit your character to this thread when you are done and it will be added 🙂

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

Oh yeah, there is also a template you can use to help you design your pixel person if you don’t know how… just save Sintaxs’ and work off of that… thats what I did 😛

---

<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: [April 11, 2003, 11:22am UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/16 "2003-04-11T11:22:48Z")

</div>

Hang in there, Lost. If I told you my story, you would cheer up.

actually, in photoshop, the conventional way to view zoomed in and overall views is by using the navigator window. Just make it really large. (Less memory, more flexible, etc… (I just PS quite a bit, just never used it for Pixel People. Thanks for the tip, Pal…

---

<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: [April 11, 2003, 3:21pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/17 "2003-04-11T15:21:44Z")

</div>

Well it depends on what your story is 😛 If your story is happy, then maybe it would, but if your story is not happy, then it won’t… 😉

I never use the navigator window, I dunno, I just don’t really like it that much, I am more comfortable with the two window method I guess :-\ It’s worked well for me so far 🙂

I can’t wait to see your Pixel Person, I am sure it will be rockin’ :beam:

---

<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: [April 11, 2003, 5:01pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/18 "2003-04-11T17:01:04Z")

</div>

Usefull thread this, nice LIB - your download is nicely annotated.

two questions I would really appreciate an answer on

```php

var howFarDown = 10-(myClip._height/2);

```

Why is it /2? wouldn’t 10-(myClip.\_height); be sufficient?

Secondly, the “prototype”, I looked in help but its all in Jargen… I don’t really understand what its all about…??

if you could help me understand those 2 bits I would be really greatful!

---

<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: [April 11, 2003, 6:44pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/19 "2003-04-11T18:44:51Z")

</div>

Well it all depends on where the registration point is located, and the size of the clip.

In my case I made the registration point at the Top-Center of the mc that I use to scroll. And I made the height of the clip twice the height of the mask.

So… since the top of the mask is located at \_y=10, I need to take that point and subtract the height of the clip… but divide it in half since the clip is twice the height of the mask.

As for prototypes… I learned prototypes from here…

[http://www.kirupa.com/developer/actionscript/tricks/prototypes.asp](http://www.kirupa.com/developer/actionscript/tricks/prototypes.asp)

If anyone knows any better tutorials on it… please post it, but the above was more than enough for 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: [April 11, 2003, 7:38pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/20 "2003-04-11T19:38:24Z")

</div>

k, I c.

ty.

(^ nice eh, not 1 word used :bandit: )

[Next page](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873.md?page=2)
