# Dragging Buttons?

**URL:** <https://forum.kirupa.com/t/dragging-buttons/8993>\
**Category:** flash\
**Created:** [December 2, 2002, 3:53pm UTC](https://forum.kirupa.com/t/dragging-buttons/8993 "2002-12-02T15:53:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Furious5](https://avatars.discourse-cdn.com/v4/letter/f/bb73d2/32.png) [@Furious5](https://forum.kirupa.com/u/Furious5)\
**Post date:** [December 2, 2002, 3:53pm UTC](https://forum.kirupa.com/t/dragging-buttons/8993/1 "2002-12-02T15:53:11Z")

</div>

I’m messing around with a text box scroller.

I want to be able to click on the scroller bar and drag it up and down accordingly.

My problem is that I am struggling to get it move vertically, what am I doing wrong.

Here is the code I am using:

on (press) {  
startDrag ("\_root.scroller", false, 578, 35, 578, 163);  
}  
on (release) {  
stopDrag ();  
}

---

<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:** [December 2, 2002, 3:58pm UTC](https://forum.kirupa.com/t/dragging-buttons/8993/2 "2002-12-02T15:58:00Z")

</div>

code is down farther

---

<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:** [December 2, 2002, 4:22pm UTC](https://forum.kirupa.com/t/dragging-buttons/8993/3 "2002-12-02T16:22:36Z")

</div>

The button is already contained within the movieclip…

I’ve tried the code you suggested, but I can’t even get the scroll bar to move…

---

<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:** [December 2, 2002, 4:25pm UTC](https://forum.kirupa.com/t/dragging-buttons/8993/4 "2002-12-02T16:25:43Z")

</div>

Hmmmm…make sure the Y value of your mouse is between the two numbers in the second code. I changed the code a little bit too…

put this code on the button:

```php

on(press){
   _root.nFlag = true
}
on(release){
   _root.nFlag = false
}

```

then on the movie clip put this code

```php

onClipEvent(enterFrame){
   if(_root.nFlag){
      if(_root._ymouse <= 400 && _root._ymouse >= 0){
         this._y = _root._ymouse
      }
   }
}

```

---

<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:** [December 2, 2002, 4:37pm UTC](https://forum.kirupa.com/t/dragging-buttons/8993/5 "2002-12-02T16:37:13Z")

</div>

That works, I had to delete the name from the movie clip.

The only problem is that I need the movie clip named scroller, for the up and down buttons to move the scroller bar…

---

<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:** [December 2, 2002, 6:38pm UTC](https://forum.kirupa.com/t/dragging-buttons/8993/6 "2002-12-02T18:38:48Z")

</div>

The name really shouldn’t have anything to do with it. I can’t really help you that much because I don’t have Flash installed on the computer that I am working with at the moment, and I won’t be on that computer for a couple days. Hopefully someone else will be able to help…
