A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: help please

  1. #1
    Registered User
    Join Date
    Apr 2012
    Posts
    1

    help please

    Hi all. I am taking a class and need to complete a project using Flash CS4. I have most of it completed. I chose a lesson on habitats. I have everything done, but don't know how to finish it. My goal was to be able to drag the animals to the correct habitat and if it was correct, have the animal disappear. If the student was wrong with their choice of habitat, then the animal would go back to the group to try again.

    If this doesn't make sense, then I am sorry.

    I think what I am asking is how to make a drag and drop game?

    Hope someone can help soon. Even the instructor is not sure how to do it. I think that is taught in part 2 of the class. I don't want to start over but I will if I have to.

    Thanks in advance!

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    AS2:

    Actionscript Code:
    if(animal_mc.hitTest(target1_mc)){
        // if correct, do something
    } else if(animal_mc.hitTest(target2_mc)){
        // if correct, do something
    } // etc...

    AS3:

    Actionscript Code:
    if(animal_mc.hitTestObject(target1_mc)){
        // if correct, do something
    } else if(animal_mc.hitTestObject(target2_mc)){
        // if correct, do something
    } // etc...
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

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