A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Flash CS5:(URGENT)Drag & Drop followed by a change of frame in target moviclip (AS 2)

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    3

    Question Flash CS5:(URGENT)Drag & Drop followed by a change of frame in target moviclip (AS 2)

    Hi all!
    I'm having a lot of projects and I really have to have this little issue surpassed as soon as possible.
    Basically we are developing a mobile application for restaurants and there is a part where we drag and drop the requests of the clients in a *don't know the name in english*(the thing where you impale? your papers).
    What i've done so far was to drag & drop (easy) but the issue is, I want to remove the paper when the user drops the "paper" above the *object* and then the object goes to frame 2 (which has one paper sticked in) and so on.

    Thanks in Advance!

    W.

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Code:
    spindle.gotoAndStop(1);
    
    paper1.onPress = moveMe;
    paper2.onPress = moveMe;
    paper3.onPress = moveMe;
    
    function moveMe() {
            this.startDrag();
            this.swapDepths(this._parent.getNextHighestDepth());
            this.onMouseUp = dropMe;
    }
    function dropMe() {
            stopDrag();
            if (eval(this._droptarget)._name == "spindle") {
                    spindle.gotoAndStop(spindle._currentframe + 1);
                    this.removeMovieClip();
            }
    }

  3. #3
    Junior Member
    Join Date
    May 2013
    Posts
    3
    Thanks dawsonk!
    Exactly what I wanted! Just one more thing: If I miss the spindle when I drop the paper it does not goes back to the original position, what is the command that states the initial position x and y? because if I put x and y it will assume that those coordinates are the ones he is currently on and not the initial ones.

  4. #4
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Code:
    spindle.gotoAndStop(1);
    
    paper1.onPress = moveMe;
    paper2.onPress = moveMe;
    paper3.onPress = moveMe;
    
    function moveMe() {
            if (this.orgX == undefined) {
                    this.orgX = this._x;
                    this.orgY = this._y;
            }
            this.startDrag();
            this.swapDepths(this._parent.getNextHighestDepth());
            this.onMouseUp = dropMe;
    }
    function dropMe() {
            stopDrag();
            if (eval(this._droptarget)._name == "spindle") {
                    spindle.gotoAndStop(spindle._currentframe + 1);
                    this.removeMovieClip();
            } else {
                    this._x = this.orgX;
                    this._y = this.orgY;
            }
    }

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