# 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:** 16
**Page:** 3

<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 9, 2003, 7:49pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/41 "2003-07-09T19:49:47Z")

</div>

need i say it worked like a charm.  
thnx man.  
You even thought me sum’n new, i never realised that u could mix commands like that b4.

---

<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 9, 2003, 7:51pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/42 "2003-07-09T19:51:55Z")

</div>

You’re welcome 🙂  
:thumb:

---

<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 9, 2003, 7:53pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/43 "2003-07-09T19:53:06Z")

</div>

whoa, not so fast claudio!  
i just deleted the two first frames of my movie cuz i decided not to use the preloader i had on them anymore and now the scrollin effect isnt working anymore.

---

<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 9, 2003, 7:55pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/44 "2003-07-09T19:55:01Z")

</div>

Hmmm weird. Are you sure there werent no actions on the first 2 frames?  
:-\

---

<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 9, 2003, 8:01pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/45 "2003-07-09T20:01:15Z")

</div>

u mean b4 or after deleting

---

<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 9, 2003, 8:02pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/46 "2003-07-09T20:02:55Z")

</div>

Yeah

---

<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 9, 2003, 8:15pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/47 "2003-07-09T20:15:59Z")

</div>

both.  
b4, i had the actions related to the preloading.  
after, i have actions relating to some “pop up” functions and a stop function.

---

<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 9, 2003, 8:17pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/48 "2003-07-09T20:17:33Z")

</div>

Can you post ur fla?

---

<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 9, 2003, 8:26pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/49 "2003-07-09T20:26:01Z")

</div>

cant, my contract forbids 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: [July 9, 2003, 8:30pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/50 "2003-07-09T20:30:52Z")

</div>

Sorry, i cant see why its not working wihtout seeing the code.

---

<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 9, 2003, 8:37pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/51 "2003-07-09T20:37:11Z")

</div>

um heres the code on the first layer of the first frame  
[AS] Movieclip.prototype.openWinCentre = function (url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {  
getURL (“javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open(’” + url + “’,’” + winName + “’,’” + “width=” + w + “,height=” + h + “,toolbar=” + toolbar + “,location=” + location + “,directories=” + directories + “,status=” + status + “,menubar=” + menubar + “,scrollbars=” + scrollbars + “,resizable=” + resizable + “,top=’+((screen.height/2)-(” + h/2 + “))+’,left=’+((screen.width/2)-(” + w/2 + “))+’” + “’)}else{myWin.focus();};void(0);”);  
}  
stage.showmenu=false;[/AS]

and this is the code on the third layer of the first frame  
[AS]stop();  
[/AS]

---

<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 9, 2003, 8:46pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/52 "2003-07-09T20:46:03Z")

</div>

That code wont affect the buttons. After u deleted the first 2 frames, everythig is working right except the dragOut 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: [July 9, 2003, 8:54pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/53 "2003-07-09T20:54:44Z")

</div>

no, the up and down buttons stop responding completely

---

<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 9, 2003, 8:59pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/54 "2003-07-09T20:59:12Z")

</div>

Then you must have erased the prototype for scrolling the movie clip.

---

<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 9, 2003, 9:10pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/55 "2003-07-09T21:10:37Z")

</div>

no comprende. :\> whats a prototype.  
do u mean this, cuz its still there  
[AS]//speed of scroll  
var speed = 15;  
//Stopping \_y Coord for Scroll Up Button  
var howFarUp = 470;  
//Stop \_y Coord for Scroll Down Button  
//my example as a registration point in the top center  
//so this can change depending on registration point location  
var howFarDown = 10-(myClip.\_height/2);  
//prototype function for scrolling up button  
MovieClip.prototype.moveUp = function() {  
//when it enters the frame  
this.onEnterFrame = function() {  
//if myClip is less than or equal to howFarUp  
if (myClip.\_y\>=howFarUp) {  
//delete the onEnterFrame so it can’t scroll anymore  
delete this.onEnterFrame;  
} else {  
//else keep scrolling it  
myClip.\_y += speed;  
}  
};  
};  
//prototype function for down button  
MovieClip.prototype.moveDown = function() {  
//when it enters the frame  
this.onEnterFrame = function() {  
//if myClip.\_y less than or equal to howFarDown  
if (myClip.\_y\<=howFarDown) {  
//delete the onEnterFrame so it can’t scroll  
delete this.onEnterFrame;  
} else {  
//else keep scrolling it  
myClip.\_y -= speed;  
}  
};  
};  
//when the “up” movie clip button is pressed call the moveUp function  
up.onPress = moveUp;  
//when the “down” movie clip button is pressed call the moveDown function  
down.onPress = moveDown;  
//when either of the movie clip buttons are released delete the onEnterFrame to stop scrolling  
up.onRelease = down.onRelease=function () {  
delete this.onEnterFrame;  
};  
[/AS]

---

<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 9, 2003, 9:23pm UTC](https://forum.kirupa.com/t/up-down-mc-scroll-buttons/17873/56 "2003-07-09T21:23:37Z")

</div>

Ok, remove the dragOut i told you to use before. Now replace this  
[AS]up.onRelease = down.onRelease=function () {  
delete this.onEnterFrame;  
[/AS]For this:  
[AS]up.onRelease = down.onRelease = up.onDragOut = down.onDragOut = function () {  
delete this.onEnterFrame;[/AS]

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