A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Dragging Buttons and Movie Clips

  1. #1
    Member
    Join Date
    Jul 2002
    Posts
    38
    I've been having a rough time getting an object on my stage to drag. I'm not sure the proper way to do this, can anyone enlighten me?

  2. #2
    Senior Member
    Join Date
    Mar 2001
    Location
    Hampshire UK
    Posts
    951
    make sure the object is a movie clip then right click on it down to actions and enter this sript:

    onClipEvent (mouseDown) {
    startDrag ("", true);
    }
    onClipEvent (mouseUp) {
    stopDrag ();
    }



    Hope that helps

  3. #3
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    You might need to make sure the mouse was pressed over the movie clip in the mouseDown event

    onClipEvent(mouseDown) {
    if (this.hitTest(_root._xmouse,_root._ymouse,true)) {
    startDrag("",true);
    }
    }

    BTW toony, the little red ninja stuff is looking good
    I haven't forgotten spacecadets though, i've been working on it today I just changed my server to apache

  4. #4
    Senior Member
    Join Date
    Mar 2001
    Location
    Hampshire UK
    Posts
    951
    Originally posted by catbert303

    BTW toony, the little red ninja stuff is looking good
    I haven't forgotten spacecadets though, i've been working on it today I just changed my server to apache
    Me either the note on my notice board reads 'MUST GET ON AND DO CHARACTERS FOR CATBERT (well your real name is used)'

    So thanks for another reminder..lol

    Take care

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