Need conceptual help for a simple drag n drop game

As anyone who saw my previous thread knows, I'm trying to make an educational app prototype (I'm new to Flash, this is for a Masters in education) to help students learn IPA symbols (phonetics). I have successfully made a section where the students click on symbols to hear the corresponding audio and listen to explanations.
For the final part of the prototype, I have to create some kind of instructional game. My idea is to have 12 circles, each one playing an audio file of a vowel sound (this I know how to do). The students will have to click the circles to listen and then drag and drop them to the correct IPA symbol. Flash would then give feedback on correct/incorrect answers and a score. Maybe all of this is against the clock, needing a timer.
So, I need to learn drag and drop. What else to I need to learn so that one drop position is considered "correct", the others are considered "incorrect" and a score is given at the end? And maybe a timer?)
Any conceptual help gratefully received!!
Darren

Cheers for the reply.
Yes, I have heard of this Google you speak of The thing is, sometimes as a beginner you can't see the wood for the trees and I find mountains of info when I search, it's hard to know which direction to do in. As for drag & drop I had already found good tutorials on that, it's more the other concepts that need to be employed that I would like information on.
I'll look into the getTomer() function, sounds just what I need.
As for the scoring correct/incorrect answers, i found a wonderful example on flashkit.com, which would basically solve all my problems if I learn how to adapt it. The trouble is it was made in Flash 7, I'm on CS4.
How many changes would I need to make to the code to turn it into AS3?
Cheers everyone
Darren
(EDIT: I pasted the code and now it looks weird. I used SQL syntax highlighting on this page, maybe somebody could tell me how to past code and get it looking correct?)
myAnswers = [[1, 1], [2, 2], [3, 5], [4, 4]];
function doDrop(dragSprite, numTargets) {
     for (i=1; i<numTargets+1; i++) {
          if (_root[dragSprite].hitTest("_root.q"+i)) {
               if (_root["q"+i]._currentframe<>2) {
                    _root[dragSprite]._x = _root["q"+i]._x+5;
                    _root[dragSprite]._y = _root["q"+i]._y+2;
                    _root["q"+i].gotoAndStop(2);
               } else {
                    _root[dragSprite]._x = _root[dragSprite].stx;
                    _root[dragSprite]._y = _root[dragSprite].sty;
function clearDrop(dragSprite, numTargets) {
     for (i=1; i<numTargets+1; i++) {
          if (_root[dragSprite].hitTest("_root.q"+i)) {
               if (_root["q"+i]._currentframe == 2) {
                    _root["q"+i].gotoAndStop(1);
                    break;

Similar Messages

  • Please help with simple Drag N Drop

    I’m desperate and need some help with this simple drag
    and drop. Here is the scenario…this animation is for a
    kindergarten course. I have 6 different colored teddy bears on the
    floor and the bears are to be placed on the middle shelf in the
    room, in no particular order. I have the code in place to drag the
    bears, and they return to their original location if dropped in the
    wrong area. Everything works, except I can’t make the bears
    stick to the target area. The target area has to be the same for
    all 6 bears. Can someone help me out with this?
    I have a feeling that the problem has something to do with my
    instance names, but I have tried everything I can think of and
    cannot get it to work. Is there some way I can post, send, or
    attach my .fla file for someone to look at? I’m desperate.
    PLEASE HELP!

    var startX3:Number;
    var startY3:Number;
    var counter3:Number=0;
    vf_A.addEventListener(MouseEvent.MOUSE_DOWN, pickUp3);
    vf_A.addEventListener(MouseEvent.MOUSE_UP, dropIt3);
    vf_E.addEventListener(MouseEvent.MOUSE_DOWN, pickUp3);
    vf_E.addEventListener(MouseEvent.MOUSE_UP, dropIt3);
    vf_I.addEventListener(MouseEvent.MOUSE_DOWN, pickUp3);
    vf_I.addEventListener(MouseEvent.MOUSE_UP, dropIt3);
    vf_O.addEventListener(MouseEvent.MOUSE_DOWN, pickUp3);
    vf_O.addEventListener(MouseEvent.MOUSE_UP, dropIt3);
    vf_U.addEventListener(MouseEvent.MOUSE_DOWN, pickUp3);
    vf_U.addEventListener(MouseEvent.MOUSE_UP, dropIt3);
    function pickUp3(event:MouseEvent):void {
    event.target.startDrag(true);
    reply2_txt.text="";
    event.target.parent.addChild(event.target);
    startX2=event.target.x;
    startY2=event.target.y;
    function dropIt3(event:MouseEvent):void {
    event.target.stopDrag();
    var myTargetName:String="target"+event.target.name;
    var myTarget:DisplayObject=getChildByName(myTargetName);
    if (event.target.dropTarget != null &&
    event.target.dropTarget.name == "instance112") {
    reply2_txt.text="Good Job!";
    event.target.removeEventListener(MouseEvent.MOUSE_DOWN,
    pickUp3);
    event.target.removeEventListener(MouseEvent.MOUSE_UP,
    dropIt3);
    event.target.buttonMode=false;
    event.target.x=myTarget.x;
    event.target.y=myTarget.y;
    var mySound:Sound = new vowels_NAR_goodjob();
    mySound.play();
    counter3++;
    } else {
    reply2_txt.text="Try Again!";
    event.target.x=startX2;
    event.target.y=startY2;
    var mySound2:Sound = new vowel_NAR_nopetryagain();
    mySound2.play();
    if (counter2==5) {
    reply2_txt.text="Great Job! You did it!";
    gotoAndPlay(3300);
    vf_A.buttonMode=true;
    vf_E.buttonMode=true;
    vf_I.buttonMode=true;
    vf_O.buttonMode=true;
    vf_U.buttonMode=true;

  • A drag and drop game with dynamic text response

    Hi,
    I am a teacher and my school has recently upgraded to Adobe Design Premium.  Our previous version was about 5 versions out of date.
    I teach A Level which requires students to create an Interactice Multimedia product.
    In the previous 6 years, I have taught students how to create simple drag and drop game with dynamic text responses.
    Since the upgrade to Actionscript 3.0 the dynamic text response has ceased working.
    When creating the game from scratch, I need to move to Actionscript 2.0 as 3.0 does not allow me to add actionscript to objects - I know and am sure that this is a better way of doing things, but I would prefer to keep working the way I am used to.
    I use a switch case statement which I have copied below to make the drag and drop work.  The objects I apply the code to work in that they can be dragged, however, my dynamic text box with a variable name of "answer" is no longer displaying the response when an answer is left on a dropzone (rectangle converted to a symbol and given an instance name).
    on(press) {
    startdrag(this);
    on(release) {
    stopdrag();
    switch(this._droptarget) {
      case "/dropzoneB":
       _root.answer="Well done";
       break;
      case "/dropzoneA":
      case "/dropzoneC":
       _root.answer="Hopeless";
       break;
      default:
       _root.answer="";
       break;
    Any help would be much apeciated.
    Thanks
    Adrian

    To drag in as3
    blie_btn is the instance of the object drawin on the stage. In AS3 you have to assign a even listener, in this case MOUSE_DOWN, and MOUSE_UP, as we want the drag to stop if the mouse is not clicked. Then we fire the functions, and tell the object to start drag.
    // Register mouse event functions
    blue_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    blue_btn.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
    red_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    red_btn.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
    // Define a mouse down handler (user is dragging)
    function mouseDownHandler(evt:MouseEvent):void {
         var object = evt.target;
         // we should limit dragging to the area inside the canvas
         object.startDrag();
    function mouseUpHandler(evt:MouseEvent):void {
         var obj = evt.target;
              obj.stopDrag();
    if you want to make the text do what you want then something like this might work.
    In the function, you could add a text box onto the stage, give it a instance of something like outputText
    and then:
    outputText = ("Bla Bla Bla");
    (^Not sure if this will work exactly^)
    PS. I am currently a A-level student

  • Pls i need help for this simple problem. i appreciate if somebody would share thier ideas..

    pls i need help for this simple problem of my palm os zire 72. pls share your ideas with me.... i tried to connect my palm os zire72 in my  desktop computer using my usb cable but i can't see it in my computer.. my palm has no problem and it works well. the only problem is that, my  desktop computer can't find my palm when i tried to connect it using usb cable. is thier any certain driver or installer needed for it so that i can view my files in my palm using the computer. where i can download its driver? is there somebody can help me for this problem? just email me pls at [email protected] i really accept any suggestions for this problem. thanks for your help...

    If you are using Windows Vista go to All Programs/Palm and click on the folder and select Hot Sync Manager and then try to sync with the USB cable. If you are using the Windows XP go to Start/Programs/Palm/Hot Sync Manager and then try to sync. If you don’t have the palm folder at all on your PC you have to install it. Here is the link http://kb.palm.com/wps/portal/kb/common/article/33219_en.html that version 4.2.1 will be working for your device Zire 72.

  • I need ready code for a simple paint program today

    hi all I need ready code for a simple paint program today for me ics projct
    plz give me a halp on this give me what you have with you and it is so good if it look like this :
    Design a GUI based drawing Java application that works like a simple paint program
    1-There should be a number of buttons for choosing different shapes to draw. For example, there should be a button for rectangle. If user presses the rectangle button, then he can draw a rectangle using mouse. Similarly, there should be a button for each shape(rectangle, circle, ellipse, and line etc.
    2-The shapes can be filled with different colors.
    3-There should be option of moving .
    4- There should also be three menus including File, Shape, and Color menu.
    i. File menu can have menu items New and Exit. If user selects New, the drawing area will be cleared and all shapes will be erased.
    ii. Shape menu will serve the same purpose as of feature 2 described above. It will have menu items for drawing all the different shapes. For example, there will be menu item for rectangle; so user can draw a rectangle by selecting the menu item for rectangle.
    iii. Color menu will serve the same purpose as of feature 3 described above. It will have menu items for all the colors which are shown in color buttons. The user can select a color from this menu and then click inside a shape to fill it with the selected color.

    Read the Swing tutorial. There are sections on how to use menus and painting and all other kinds of stuff you need to do this homework assignment. Nobody here is going to write the code for you:
    http://java.sun.com/docs/books/tutorial/uiswing/TOC.html

  • What does a new non-DE user need? | Help for a Wiki page

    Hey Archers,
    I'm using Arch with the Compiz Standalone Window Manager and I need some help for a project.
    It turns out (who knew) that computers need a lot more to run smoothly than just a desktop and applications. You need network managers, gtk themes and much much more. Now, Desktop Environments such as GNOME and KDE provide a lot of these programs built-in, good for them, but I'm looking to build my system as dependency-free as I can and the big DE's don't really provide that. Especially GNOME just ropes me in whenever I want to use the tiniest piece of it (darn you gnome-keyring).
    So I come to you fora, with a quest for information. I want to compile an overview of essential and useful applications with minimal dependencies that allow a CompizIndy user to build his system freely. And if I get enough information, I want to turn it into its own page for the Wiki so it becomes easier to get started with a birds-eye view of what you need to flesh out your system (not exclusively for CompizIndy btw). So please help me!
    What applications/daemons/tools should a new system install? I'm not asking which ones are the best or worst or your favorites, just which kinds do you need --that aren't covered in the install guide--?
    For example it's advisable to get:
    Panel/dock
    desktop manager
    network manager
    compositing manager
    a tool for managing removable devices (ntfs-3g etc)
    a packer/unpacker
    a screensaver
    power management
    alt-F2 runcommand
    custom keybindings
    a user switch/logout manager
    a volume manager
    etc.
    So what do you recommend? What do you need to get up and going?
    Hoping to hear from you guys and girls,
    Matthias
    PS: if I'm doubling up on anything, please let me know and save me effort and embarassment ^_^
    Last edited by Matsjo (2011-01-28 20:37:26)

    There are many threads on this, although individual ones asking for "the best app to do XXX". You could try searching those. Also Search for the LnF Awards threads. you might find a few ideas there. We also have wiki pages for light-weight applications which might be useful
    Panel/dock  none
    desktop manager none
    network manager netcfg
    compositing manager none or xcompmgr (for basic compositing)
    a tool for managing removable devices (ntfs-3g etc) udiskie or udev rules or devmon
    a packer/unpacker coreutils eg - tar, bzip etc with an alias called "ex" in .aliases
    a screensaver none
    power management ???
    alt-F2 runcommand gmrun
    custom keybindings xbindkeys
    a user switch/logout manager none
    a volume manager see udiskie....
    BTW, if this is for you, then simply install Arch and use a non DE based WM --- eventually you will figure out what you are missing

  • I need some help for an explanation. Loop for 1 minute.

              int minute=1;
              long currentTime=System.currentTimeMillis();          
              long stoppingTime = currentTime + (minute * 60 * 1000);
              while (currentTime<stoppingTime) {
                   // do x;
                   currentTime=System.currentTimeMillis();
              }I want to have the loop to run for 1 minute. It does not seem to work.
    What did I miss? I need some help for an explanation.

    Ran:
    class PrintTimeAsProcess {
      public static void main(String[] argv)  throws Exception {
        int minute=1;
        long currentTime=System.currentTimeMillis();
        long stoppingTime = currentTime + (minute * 15 * 1000);
        System.out.println("START Time: "+currentTime);
        while (currentTime<stoppingTime) {
          currentTime=System.currentTimeMillis();
        System.out.println("END Time: "+currentTime);
    }Got:
    START Time: 1149278202718
    END Time: 1149278217718
    1149278217718
    -1149278202718
    15000

  • HI ALL SINCE TWO DAYS I AM DOWNLOADING VIBER BUT I AM NOT HAVING MY ACCESS CODE AND EVERY TIME I DELETE THE APPLICATION AND DOWNLOADING IT AGAIN BUT ALWAYS THE SAME RESULT PLEASE I NEED YOUR HELP FOR THE ACCESS CODE.MY PHONE NUMBER IS 0022996969896.THANKS

    HI ALL SINCE TWO DAYS I AM DOWNLOADING VIBER BUT I AM NOT HAVING MY ACCESS CODE AND EVERY TIME I DELETE THE APPLICATION AND DOWNLOADING IT AGAIN BUT ALWAYS THE SAME RESULT PLEASE I NEED YOUR HELP FOR THE ACCESS CODE.MY PHONE NUMBER IS 0022996969896.THANKS IN ADVANCE

    try this website this should help you http://helpme.viber.com/index.php?/Knowledgebase/List/Index/1/iphone

  • Need help with drag and drop game, Urgent!

    Hi I have created a drag and drop game, the drag and drop is
    working alright however once the right word has been placed in the
    box, and moves on to the next question the previous correct answer
    stays where it was placed, how can i get it to snap back to its
    original location? Also when the right word is draged in to the the
    white box i want it to snap into place in that box so it fits in
    there.
    Also if you have any other thoughts and advice on how i can
    improve on this please email me thanx
    Can someone please help, my .fla file can be found here:
    http://www.freshlemon.co.uk/timeline.fla
    http://www.freshlemon.co.uk/timeline.fla.zip
    thanx

    tellTarget is ancient
    I forget what it even used to do??? hahaha
    seriously, just put in the instance name and what you want it
    to do:
    tellTarget("movieclip"){
    play();
    is now just
    movieclip.play();

  • Simple drag and drop programme. Bug

    Hi.
    I have a simple drag and drop app for learning English. You hear for eg: banana and have to drag that object to a certain area.
    When my little kid plays it she finds bugs - she's my researcher.
    It's hard to explain the bug as its hard to get it but kids can easily. You click on the target object and drag it a little, then quickly reclick it but not drag ie: release the mouse as it goes back to its initial position. You move the mouse away and and the object follows mouse even though you are now not dragging and you can't drop it.
    I know its hard to imagine this but perhaps this is a know bug for drag and drops.
    private function dragHandler(e:MouseEvent)
                e.currentTarget.startDrag();
                xIni = e.currentTarget.x;
                yIni = e.currentTarget.y;
    The you have the following which has an event listener for the mouse up event.
    private function checkDrag(e:MouseEvent)
                e.currentTarget.stopDrag();
                if (this.currentBubble.hitTestObject(this.dragTarget))
                    if (currentBubble && currentBubble == e.currentTarget)
                        currentBubble.visible = false;
                        blnCorrect = true;
                        points = this.points + 10;
                        score.score_txt.text = String(points);
                        correct++;
                        vehiclePosition+=100;
                        TweenLite.to(animation,1,{x:vehiclePosition})
                        trace("CORRECT="+correct);
                        if (correct == 10)
                            endGame();
                            return;
                    bubbles.splice(currentIndexArray,1);//you must specify the parameter 1 ie: remove 1
                    sndChannel=soundCorrect.play();
                    sndChannel.addEventListener(Event.SOUND_COMPLETE, soundCorrectComplete)
                else
                    incorrect++;
                    sndChannel=soundIncorrect.play();
                    sndChannel.addEventListener(Event.SOUND_COMPLETE, soundIncorrectComplete);
                    TweenLite.to(e.currentTarget, 1, {x:xIni, y:yIni, ease:Strong.easeOut, onComplete:onFinishTween});

    So, the code should be like this:
    private function dragHandler(e:MouseEvent):void
         e.currentTarget.startDrag();
         stage.addEventListener(MouseEvent.MOUSE_UP, checkDrag);
         xIni = e.currentTarget.x;
         yIni = e.currentTarget.y;
    private function checkDrag(e:MouseEvent):void
         stopDrag();
         stage.removeEventListener(MouseEvent.MOUSE_UP, checkDrag);
    Also, i suggest you get into habit to ALWAYS declare datatypes, including what functions return - it is good for memory and performance. In your case, :void should be function return datatype.
    In addition, you don't need to stopDrag() on an object - since only a single object can be dragged at a time - just calling stopDrag() is sufficient.

  • I need a help !!! Please  ,I dropped my iPhone 5 in toilet and I didn't get fast  maybe 5mins before I get it because I didn't notice drop it and it won't work now  it's almost 1week I'm waiting it  still  it don't work ...

    I need a help !!! Please  ,I dropped my iPhone 5 in toilet and I didn't get fast  maybe 5mins before I get it because I didn't notice drop it and it won't work now  it's almost 1week I'm waiting it  still  it don't work ... But when I plug my charger it goes light and show up apple logo and die again I don't know what to do and it's so expensive here at Japan pls.. Help maybe there still way to get it work again
    Thank you ,Rean

    At this point it's clear that it's been damaged and will need to be take or sent to Apple for replacement.
    Regards.

  • Why am I having trouble importing vCards? I follow the Help Center instructions by dragging and dropping, but some don't sync into the cloud. And why can't I drag multiple vCards? I have over 4,000. Please tell me I don't have to do one at a time?

    Why am I having trouble importing vCards? I follow the Help Center instructions by dragging and dropping, but some don't sync into the cloud. And why can't I drag multiple vCards? I have over 4,000. Please tell me I don't have to do one at a time?

    carolinechx wrote:
    i know the description may be a little bit too confusing
    Mostly because you are not using any capital letters or paragraph returns and your post is difficult to read.

  • Balls visible in other "pages" of app after "drag n drop" game. Help plz!

    After modifying code from a tutoial I've got the drag n drop game part of my educational project app working beautifully.
    The unfortunate thing is that If I hit the home button that is common to all the "pages" in my app to move away from the game, the balls that have been dropped into the correct position remain visible on the stage in ALL other pages.
    I'm guessing this is because the AS code removes the event listener so once dragged to the correct postion in the game, they snap there and cannot be moved.
    Am I right?
    How can I solve the problem of the dropped balls being visible on other "pages"
    Thanks in advance and heres the code on that particular page of the app.
    var counter:Number = 0;
    var startX:Number;
    var startY:Number;
    peg1_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg1_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg2_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg2_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg3_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg3_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg4_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg4_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg5_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg5_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg6_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg6_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg7_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg7_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg8_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg8_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg9_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg9_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg10_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg10_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg11_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg11_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg12_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg12_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    function pickUp(event:MouseEvent):void {
        event.target.startDrag(true);
        reply_txt.text = "";
        event.target.parent.addChild(event.target);
        startX = event.target.x;
        startY = event.target.y;
    function dropIt(event:MouseEvent):void {
        event.target.stopDrag();
        var myTargetName:String = "target" + event.target.name;
        var myTarget:DisplayObject = getChildByName(myTargetName);
        if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
            reply_txt.text = "Good Job!";
            event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
            event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
            event.target.buttonMode = false;
            event.target.x = myTarget.x;
            event.target.y = myTarget.y;
            counter++;
        } else {
            reply_txt.text = "Try Again!";
            event.target.x = startX;
            event.target.y = startY;
        if(counter == 12){
            reply_txt.text = "Congrats, you're finished!";
    peg1_mc.buttonMode = true;
    peg2_mc.buttonMode = true;
    peg3_mc.buttonMode = true;
    peg4_mc.buttonMode = true;
    peg5_mc.buttonMode = true;
    peg6_mc.buttonMode = true;
    peg7_mc.buttonMode = true;
    peg8_mc.buttonMode = true;
    peg9_mc.buttonMode = true;
    peg10_mc.buttonMode = true;
    peg11_mc.buttonMode = true;
    peg12_mc.buttonMode = true;

    Sorry, I'm a bit confused by that.
    You said add code to frame 1? Frame 1 is my home section. Do you mean copy/paste your code there? Frame 1 currently looks like this:
    stop();
    learn_btn.addEventListener(MouseEvent.CLICK, learnClicked);
    function learnClicked(event:MouseEvent):void
    SoundMixer.stopAll();
    gotoAndStop("learn")
    play_btn.addEventListener(MouseEvent.CLICK, playClicked);
    function playClicked(event:MouseEvent):void
    SoundMixer.stopAll();
    gotoAndStop("play")
    test_btn.addEventListener(MouseEvent.CLICK, testClicked);
    function testClicked(event:MouseEvent):void
    SoundMixer.stopAll();
    gotoAndStop("test")
    home_btn.addEventListener(MouseEvent.CLICK, homeClicked);
    function homeClicked(event:MouseEvent):void
    SoundMixer.stopAll();
    for(var i:uint=0;i<reparentedBalls.length;i++){
    if(reparentedBalls[i]!=null){
    reparentedBalls[i].parent.removeChild(reparentedBalls[i]);
    gotoAndStop("home")
    The other bit of relevant code is on frame 42 which currently looks like this:
    var counter:Number = 0;
    var startX:Number;
    var startY:Number;
    var reparentedBalls:Array=[];
    peg1_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg1_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg2_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg2_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg3_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg3_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg4_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg4_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg5_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg5_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg6_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg6_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg7_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg7_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg8_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg8_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg9_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg9_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg10_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg10_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg11_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg11_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    peg12_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    peg12_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    function pickUp(event:MouseEvent):void {
        event.target.startDrag(true);
        reply_txt.text = "";
        event.target.parent.addChild(event.target);
    reparentedBalls.push(event.target);
        startX = event.target.x;
        startY = event.target.y;
    function dropIt(event:MouseEvent):void {
        event.target.stopDrag();
        var myTargetName:String = "target" + event.target.name;
        var myTarget:DisplayObject = getChildByName(myTargetName);
        if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
            reply_txt.text = "Good Job!";
            event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
            event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
            event.target.buttonMode = false;
            event.target.x = myTarget.x;
            event.target.y = myTarget.y;
            counter++;
        } else {
            reply_txt.text = "Try Again!";
            event.target.x = startX;
            event.target.y = startY;
        if(counter == 12){
            reply_txt.text = "Congrats, you're finished!";
    peg1_mc.buttonMode = true;
    peg2_mc.buttonMode = true;
    peg3_mc.buttonMode = true;
    peg4_mc.buttonMode = true;
    peg5_mc.buttonMode = true;
    peg6_mc.buttonMode = true;
    peg7_mc.buttonMode = true;
    peg8_mc.buttonMode = true;
    peg9_mc.buttonMode = true;
    peg10_mc.buttonMode = true;
    peg11_mc.buttonMode = true;
    peg12_mc.buttonMode = true;
    Are you telling me to change the 4th line to reparentedBalls=[]; or var reparentedBalls=[];

  • Is there any help for a cracked iphone after dropping it?

    is there any help for a cracked iphone after dropping it?

    If you have the new AppleCare+ service, then yes:
    http://www.apple.com/support/products/iphone.html
    Otherwise, maybe. Regular AppleCare, if you have it, can't help you. But you might still be able to get it repaired – of course, any repair will cost you. Apple will replace a damaged iPhone for a flat fee.
    800-MY-APPLE (800-692-7753

  • I am trying to import an mp3 audio file into garage band for editing.  drag and drop doesn't work. What now?

    I am trying to import an mp3 audio file into garage band for editing.  Drag and drop does not work. any ideas?

    Try reposting in the Garageband forums. You can find it at:
    https://discussions.apple.com/community/ilife/garageband

Maybe you are looking for