On 3/28/06, sufibaba <[EMAIL PROTECTED]> wrote:
> public function newLine(){
> var sprite:Sprite = new Sprite();
> sprite.graphics.lineStyle(1,0x000000,1,false,"NONE");
> sprite.graphics.moveTo(pt.x,pt.y);
> sprite.graphics.lineTo(cx,cy);
> this.addChild(sprite);
> sprite.addEventListener(MouseEvent.MOUSE_DOWN,dragLine);
> sprite.addEventListener(MouseEvent.MOUSE_UP,dropLine);
> }
> public function dragLine(e:Event):void
> {
> e.target.startDrag();
> }
> public function dropLine(e:Event):void
> {
> e.target.stopDrag();
> }
>
> Problem: When I drag the line over another sprite in the app and release the
> mouse button, instead of stop dragging, the line sticks to the the mouse
> pointer with the tenacity of a leech on steroids. I've tried everything
> short of Fire and Salt -- which, by the way, works fine with a real leech
> but not on my LCD screen.
Is your dropLine method even getting called? I don't think your
object is getting the mouseUp event. For this sort of a thing,
typically we use setCapture() or listen for the mouseUp event on the
"systemManager" object (which is available as a property to every
UIComponent).
Manish
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/