How to Make a Drag N' Drop Game





Introduction: How to Make a Drag N' Drop Game

Oh, the drag n' drop game. Those were part of my toddler years, and they were fun. At least, until i found out how to make them. You can make one too! Let's do it.

Stuff you need:

Flash(I'm using CS3, but you can use MX-CS4, any version that supports AS2)

It'll help if you've seen my [http://other] flash tutorial.

This is really simple.

Step 1: Doing It.

First, make 2 layers. One named "Stick" below, and one named "Objects" on top. Draw a the character you're going to dress up up, I'm using a stick figure. Next, lock the layer. Then, click on the "Objects" layer. Draw the object you'll be dragging onto the stick figure and make it a movie clip. Make sure the registration point is in the center.

Next, press F9 and TYPE this code in the movie clip'sActions box(DON'T copy and paste, you bum. how are you gonna learn the code that way? You'll wish you typed it when i get to complicated stuff):




When this object is clicked...


Start to drag it...


Closes on handler function.


When this object is released...


Stop dragging it.


Closes on handler function.

You're done, just repeat this several times. Each object you make gets this code.

Step 2: Done!

Nice job, you just made a game! Comment, rate, and tell me about any problems you have.



    • Microcontroller Contest

      Microcontroller Contest
    • Science of Cooking

      Science of Cooking
    • Pocket-Sized Contest

      Pocket-Sized Contest

    We have a be nice policy.
    Please be positive and constructive.




    Hi, What is CS3? Where can I get it? What is MX-CS4? where can I get it?

    What is AS4 how do I know if my computer supports it?

    Atleast by adding this... I can make a basic game atleast... Just currently... Making the objects required... I'll even add an image of so far (made everything from scratch on Adobe CS4)

    Drag'n'drop - Inferndragon's game.jpg

    Thankyou! I have been looking for a simple to make flash project, and your tutorial makes this one beyond easy. Your instructions are well worded and comprehensive, and your notes on what the actionscript was actually doing made it easy for a flash noob like me to understand. I still cant believe how simple it was! Thanks again.

    Thanx this really helped.

    press ctrl+enter or load the published version.

    Thanks, i'm gonna try that now!

    What layer is your custom cursor on?

    I did it but there is a problem. I have a cursor in my flash doc and it's code is: custom_cursor.startDrag("true"); Mouse.hide(); and when I drag the tshirt, the mouse stops going with the cursor. Is there a way I can fix this?