A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Drag and Drop Shuffle with AS 2.0

  1. #1
    Junior Member
    Join Date
    Apr 2009
    Posts
    2

    Drag and Drop Shuffle with AS 2.0

    I apologize in advance if this seems like an easy problem but I can't figure it out and it's driving me crazy! Any help is appreciated.


    I have three movie clips in a horizontal line (MC1, MC2, MC3) that need to be shuffled around to three set locations - you could call them targets but I haven't set them up to be targets. I need to pick up one movie clip and drag it to another movie clip's location, have the other movie clip (or clips) move out of the way while I am still dragging the first movie clip. And so on and so forth.

    I have the move function working when the dragged movieclip is released, but I don't know how to get the other movie clips to get out of the way while the dragged movie clip is still "in action". This has to be done using Actionscript 2.0.

    I'm attaching a drawing to help visualize. Any ideas?
    Attached Images Attached Images

  2. #2
    |-'|-'|
    Join Date
    Jan 2006
    Posts
    273
    this is not exactly what you wanted, but it should get you started.
    Attached Files Attached Files

  3. #3
    Junior Member
    Join Date
    Apr 2009
    Posts
    2
    Thanks very much, Gu35s!

    Could you please tell me how to modify the code so that the transitions are smooth and not "snappy"?

  4. #4
    |-'|-'|
    Join Date
    Jan 2006
    Posts
    273
    by setting a variable to hold the target's next position and moving _x and _y toward it instead of setting the _x and _y immediately to the target's position.

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