# Constraining startDrag in as3

**URL:** <https://forum.kirupa.com/t/constraining-startdrag-in-as3/291812>\
**Category:** Uncategorized\
**Created:** [July 6, 2009, 9:21am UTC](https://forum.kirupa.com/t/constraining-startdrag-in-as3/291812 "2009-07-06T09:21:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![romit\_2034](https://avatars.discourse-cdn.com/v4/letter/r/ed655f/32.png) [@romit\_2034](https://forum.kirupa.com/u/romit_2034)\
**Post date:** [July 6, 2009, 9:21am UTC](https://forum.kirupa.com/t/constraining-startdrag-in-as3/291812/1 "2009-07-06T09:21:29Z")

</div>

Hi,

Below is a sample of my code

function startScroll(e:MouseEvent):void {  
e.currentTarget.startDrag(false,0,0,500,0)  
}

I need to limit my drag only to x axis so I have used the rectangle dimensions above to constrain. However every time I try to drag something I get the following error.

ArgumentError: Error #1063: Argument count mismatch on flash.display::Sprite/startDrag(). Expected 0, got 5.  
at homev\_fla::MainTimeline/startScroll()

Can someone please tell me what I am doing wrong. Have been struggling with this for a really long time now.
