Make Drag And Drop Game by husna208

VIEWS: 265 PAGES: 4

More Info
									                                                                                                             Home Sign Up! Explore Community Submit
 All       Art      Craft        Food          Games            Green          Home          Kids         Life       Music          Offbeat          Outdoors             Pets        Ride         Science           Sports          Tech



How to Make a Drag n' Drop Game
by lawizeg on November 13, 2008


Table of Contents

intro: How to Make a Drag n' Drop Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .                     2

step 1: Doing it. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    2

step 2: Done! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .    3

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .      4

Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .     4

    Make Magazine Special Offer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .              4

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .   4




http://www.instructables.com/id/How_to_Make_a_Drag_n_Drop_Game/
intro: 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)
Computer

It'll help if you've seen my [http://other http://www.instructables.com/id/How_to_Make_a_Preloader_in_Flash/?ALLSTEPS] flash tutorial.

This is really simple.




  Image Notes
  1. lol.




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){
http://www.instructables.com/id/How_to_Make_a_Drag_n_Drop_Game/
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.




    Image Notes
    1. lol.




http://www.instructables.com/id/How_to_Make_a_Drag_n_Drop_Game/
   Related Instructables
Advertisements
Make Magazine Special Offer




   Comments
               2 comments             Add Comment

                              Seifpic says:                                                                        Feb 21, 2009. 1:33 AM REPLY
                              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?



                              Seifpic says:                                                                        Feb 21, 2009. 1:04 AM REPLY
                              Thanks, i'm gonna try that now!




   http://www.instructables.com/id/How_to_Make_a_Drag_n_Drop_Game/

								
To top