loading
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)
Computer

It'll help if you've seen my [http://other https://www.instructables.com/id/How_to_Make_a_Preloader_in_Flash/?ALLSTEPS] 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):

on(press){
this.startDrag(true);
}
on(release){
this.stopDrag(true);
}

Explanation:

on(press){

When this object is clicked...

this.startDrag(true);

Start to drag it...

}

Closes on handler function.

on(release){

When this object is released...

this.stopDrag(true);

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.
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)
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.
Now how do i play the game?
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?

About This Instructable

11,716views

8favorites

License:

Bio: I like to draw, play my guitar, play sports, even though im kinda lazy. I'd like to think that i'm good at a ... More »
More by lawizeg:How to Add How to Make a Drag n' Drop Game How to Make a Preloader in Flash 
Add instructable to: