# How to alter the mousedrag speed on mouse drag & drop?

**URL:** <https://forum.kirupa.com/t/how-to-alter-the-mousedrag-speed-on-mouse-drag-drop/296588>\
**Category:** flash\
**Created:** [September 17, 2009, 1:44am UTC](https://forum.kirupa.com/t/how-to-alter-the-mousedrag-speed-on-mouse-drag-drop/296588 "2009-09-17T01:44:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![megawinks](https://avatars.discourse-cdn.com/v4/letter/m/bc8723/32.png) [@megawinks](https://forum.kirupa.com/u/megawinks)\
**Post date:** [September 17, 2009, 1:44am UTC](https://forum.kirupa.com/t/how-to-alter-the-mousedrag-speed-on-mouse-drag-drop/296588/1 "2009-09-17T01:44:52Z")

</div>

Hi there,

I’m animating this scene where a sliding On/Off switch responds to mousedrag. I have already constrained its movement to the Y-direction. But now I want to make this movieclip, called “MGAswitch”, to slide at a slower speed instead of the real-time mousedrag speed to simulate friction/resistance. How do I go about doing it?

Here’s my code:

```auto
stop();

var myBoundaries:Rectangle=new Rectangle(431,409.5,0.1,-15);
var myLoader2a:Loader=new Loader ();

MGAswitch.addEventListener(MouseEvent.MOUSE_DOWN,dragSwitch);
function dragSwitch(event:MouseEvent):void {
    MGAswitch.startDrag(false,myBoundaries);
}
stage.addEventListener(MouseEvent.MOUSE_UP,dropSwitch2a);
function dropSwitch2a(event:MouseEvent):void {
    MGAswitch.stopDrag();
    if ((MGAswitch.hitTestObject(targetArea))) {
        //trace("success");
        var myURL2a:URLRequest=new URLRequest("page3.swf");
        myLoader2a.load(myURL2a);
        addChild(myLoader2a);
    }
}
targetArea.addEventListener(Event.ENTER_FRAME, hitTest);
function hitTest(yourEvent:Event):void {
}
myLoader2a.addEventListener(MouseEvent.CLICK, unloadcontent2a);
function unloadcontent2a(myevent:MouseEvent):void {
    removeChild(myLoader2a);
}

```

Thanks so much!
