Excellent!!

That resolves limiting the dragged item to the rectangle, however, 
the mouse still can leave the drag area. If the mouse button is 
released outside of the rectangle, the mouse_move and mouse_up events 
does not fire (as expected), and you can be left with a floating 
item, in this case, a button. So, can I keep the mouse within the 
same rectangle, only while dragging?

--- In [email protected], "iilsley" <[EMAIL PROTECTED]> wrote:
>
> 
> The 2nd argument to startDrag is of type 'Rectangle' . 
> 
> try:
> var r:Rectangle = new Rectangle
(10,0,myCanvas.width,myCanvas.height);
> event.target.startDrag(false, r);
> 
> 
> --- In [email protected], "jmfillman" <jmfillman@> wrote:
> >
> > Well that's what I thought, but when I change this:
> > 
> > event.target.startDrag();
> > 
> > to this:
> > 
> > event.target.startDrag(false, 10, 0, myCanvas.width, 
myCanvas.height);
> > 
> > I get the following error:
> > 
> > ArgumentError: Error #1063: Argument count mismatch on 
> > flash.display::Sprite/startDrag(). Expected 0, got 5.
> > 
> 
> > > ---------
> > > startDrag(lockCenter:Boolean = false, bounds:Rectangle = 
null):void
>


Reply via email to