# Double Drag

**URL:** <https://forum.kirupa.com/t/double-drag/133894>\
**Category:** Uncategorized\
**Created:** [January 12, 2005, 9:04pm UTC](https://forum.kirupa.com/t/double-drag/133894 "2005-01-12T21:04:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tklaver](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@tklaver](https://forum.kirupa.com/u/tklaver)\
**Post date:** [January 12, 2005, 9:04pm UTC](https://forum.kirupa.com/t/double-drag/133894/1 "2005-01-12T21:04:48Z")

</div>

Hi all,

At first, I’m really new to action scripting and flash. Honestly I’ve only started using it since yesterday. I managed to create a dragable volume bar which is working. Though I want to add a second piece to it.

```auto
this.ratio=0 ;
_root.mySlider.dragger.onPress=function(){
 _root.mySlider.dragger.startDrag(true,0,0,line._width,0);

 _root.mySlider.dragger.onEnterFrame=function(){
  trace ("onEnterFrame called");
  ratio=Math.round(_root.mySlider.dragger._x*100/line._width) ;
  _root.volume = ratio;
  //_root.caption.startDrag(true);
  _root.caption.words = "VOLUME " + _root.volume + "%";
 }
 
}
_root.mySlider.dragger.onRelease=_root.mySlider.dragger.onReleaseOutside=_root.mySlider.dragger.stopDrag;

```

I’ve commented the piece which should be dragged also, as its brakes the volume bar and the caption part is only dragged at that time.

Also, is the last line of code adjustable so it fits into a function? I’ve tried

```auto
_root.mySlider.dragger.onRelease=_root.mySlider.dragger.onReleaseOutside = function() {
_root.mySlider.dragger.stopDrag;
}

```

though that didnt work.

I’m sorry if I’m abit unclear, I’m not a native english speaker 😉

Thanks for the great tutorials, they helped me alot creating this 🙂
