A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: startDrag() - Object back to original position?

  1. #1
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167

    startDrag() - Object back to original position?

    Hey everyone,

    Well I have a seemingly simple question here. I have a box , thats right a nice shiney box , and within it contains a smaller blue box which is a movieclip.

    Now, when you click this small worthless little box, startDrag(); begins and it follows you around : onClipEvent (mouseDown){

    When you release this box, it goes back to its start position , into the centre of the bigger box : onClipEvent(mouseUp){


    Thats whats supposed to happen. You click and it follows until you release the mouse and it'll go back to its original position.

    Now the problem is this:


    After releasing the small box, it goes back to its original position, but continues to follow the mouse from there ... but just from the distance. In other words, startDrag(false); hasnt really worked


    Heres the code :

    code:
    onClipEvent (load) {
    startX = this._x;
    startY = this._y;
    }
    //
    onClipEvent (mouseDown) {
    this.startDrag(true);
    }
    //
    onClipEvent (mouseUp) {
    this.startDrag(false);
    this._x = this.startX;
    this._y = this.startY;
    }




    If anyone could help me out here?

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    stopDrag();

  3. #3
    An FKer
    Join Date
    Sep 2005
    Location
    Ontario
    Posts
    1,167
    ...

    Well then ...

    ...

    *BLINKS*

    ...

    Thanks?


    HAHAHA, wow do I feel like an idiot

    Anyways, thanks for the reply

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