A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Dragging the entire screen? (startDrag)

  1. #1
    Junior Member
    Join Date
    Jan 2009
    Posts
    23

    Dragging the entire screen? (startDrag)

    I'm trying to get objects to drag and drop.

    Instead of dragging just the circle, it drags the entire screen. I can get it to work if I use "this.circle.startDrag()" but I want to be able to use the startMove and stopMove functions on different children, text boxes and other objects generically. Here's the code:

    circle.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    circle.addEventListener(MouseEvent.MOUSE_UP, stopMove);

    function startMove(event:MouseEvent):void {
    this.startDrag();
    }
    function stopMove(event:MouseEvent):void {
    this.stopDrag();
    }

    Any idea how I can get this to work?

  2. #2
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    function startMove(event:MouseEvent):void {
    event.currentTarget.startDrag();
    }
    function stopMove(event:MouseEvent):void {
    event.currentTarget.stopDrag();
    }

  3. #3
    Junior Member
    Join Date
    Jan 2009
    Posts
    23
    I tried that but it gives me an error:

    "Property startDrag not found on flash.display.Loader and there is no default value."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center