AS2 Drag and Drop - Completion Response

I am making a drag and drop alphabet learning game. There are 27 Movie Clips (letters) in total that are able to be dragged.  I've made it so that 12 of the Movie Clips will drop in a specific DropZone, while the rest will just snap back to their original position.
What I'd like to do is create a completion response that moves to a separate "Good Job!" screen when all 12 Movie Clips have been droped in the DropZone.  How can I do this?  I've searched online for some help but nothing seems to be particularly relevant.
Thanks!

So I've tried adding this code but I still can't get the right result.
My first letter has this code:
food1_mc.onPress=function(){
startDrag(this);
var dropCount = 0;
food1_mc.onRelease=food1_mc.onReleaseOutside=function(){
    stopDrag();
    if (this._droptarget == "/DropZone4") {
            this.onTarget=true;
            _root.DropZone4.gotoAndStop(2);
            dropCount += 1;  // add 1 to the dropCount
            if(dropCount == 12){
                  gotoAndStop("goodjob");  // go to the frame labeled goodjob 
    } else {
            this.onTarget=false;
            _root.DropZone4.gotoAndStop(1)
food1_mc.myHomeX=food1_mc._x;
food1_mc.myHomeY=food1_mc._y;
food1_mc.onMouseDown=function(){
mousePressed=true;
food1_mc.onMouseUp=function(){
mousePressed=false;
food1_mc.onEnterFrame=function(){
if(mousePressed==false&&this.onTarget==false){
this._x-=(this._x-this.myHomeX)/5;
this._y-=(this._y-this.myHomeY)/5;
I've also added what you posted to the other 11 letters.  The first letter seems to work find but all other 11 have lost their ability to snap back into position or drop in the DropZone (they just stick to my mounse after I click on them).  Do I need to change the code for each letter somehow?  I've tried changing if(dropCount == 12){ to if(dropCount == 1){ to test if the one letter that's still dropping can activate the result, and it can't.  I've made sure the frame is named goodjob.  Thoughts?

Similar Messages

  • AS2 Drag and Drop Interaction help

    I am trying to create a reusable template for a drag and drop interaction.
    There are 7 drag objects, 7 targets.
    Based on a scenario we develop (which of the 7 services [drag objects] are the best solution, for example), I would like to create interactions where some of the drag drop combinations are correct answers and dragging/dropping other combinations would result in an "incorrect" answer.
    I am having issues with designating the correct and incorrect responses in the AS code, as well as how to provide the positive (correct answers) and negative (incorrect answers) feedback after a submit button is selected.
    Additionaly, I have a reset button that does not function the way I expected - move the drag objects back to the start position and allow the user to resubmit an answer.
    I am using Flash CS5, but need to use AS2 as the swf file is going to be inserted into an Articulate Presenter project (Articulate does not support AS3 yet).
    Thank you for any assistance or suggestions!
    Source file: https://www.dropbox.com/home/AS2%20D&D#:::68035214
    Current AS2 code:
    function dragSetup(clip, targ) {
    clip.onPress = function() {
    startDrag(this);
    this.beingDragged=true;
    clip.onRelease = clip.onReleaseOutside=function () {
    stopDrag();
    this.beingDragged=false;
    if (eval(this._droptarget) == targ) {
    this.onTarget = true;
    _root.targ.gotoAndStop(2);
    } else {
    this.onTarget = false;
    _root.targ.gotoAndStop(1);
    //the variables below will store the clips starting position
    clip.myHomeX = clip._x;
    clip.myHomeY = clip._y;
    //the variables below will store the clips end position
    clip.myFinalX = targ._x;
    clip.myFinalY = targ._y;
    clip.onEnterFrame = function() {
    //all these actions basically just say "if the mouse is up (in other words - the clip is not being dragged)
    // then move the MC back to its original starting point (with a smooth motion)"
    if (!this.beingDragged && !this.onTarget) {
    this._x -= (this._x-this.myHomeX)/5;
    this._y -= (this._y-this.myHomeY)/5;
    //if the circle is dropped on any part of the target it slides to the center of the target
    } else if (!this.beingDragged && this.onTarget) {
    this._x -= (this._x-this.myFinalX)/5;
    this._y -= (this._y-this.myFinalY)/5;
    dragSetup(drag1,drop1);
    dragSetup(drag2,drop2);
    dragSetup(drag3,drop3);
    dragSetup(drag4,drop4);
    dragSetup(drag5,drop5);
    dragSetup(drag6,drop6);
    dragSetup(drag7,drop7);
    //this code controls the reset button function and returns all of the drag objects to the start position.
    resetBtn.onRelease = function (){
    drag1.onTarget=false;
    drag1._x = drag1.myHomeX;
    drag1._y = drag1.myHomeY;
    drag2.onTarget=false;
    drag2._x = drag2.myHomeX;
    drag2._y = drag2.myHomeY;
    drag3.onTarget=false;
    drag3._x = drag3.myHomeX;
    drag3._y = drag3.myHomeY;
    drag4.onTarget=false;
    drag4._x = drag4.myHomeX;
    drag4._y = drag4.myHomeY;
    drag5.onTarget=false;
    drag5._x = drag5.myHomeX;
    drag5._y = drag5.myHomeY;
    drag6.onTarget=false;
    drag6._x = drag6.myHomeX;
    drag6._y = drag6.myHomeY;
    drag7.onTarget=false;
    drag7._x = drag7.myHomeX;
    drag7._y = drag7.myHomeY;
    //This code controls the submitBtn and feedback for a correct and incorrect answer
    var groupID:Array = [0,0];
    var incorrectFeedback:String = "That isn't correct.";
    var correctFeedback:String = "Excellent good work.";
    var answerGroup:Array =  [
                                                                 [drag1,drop1],
                                                                 [drag2,drop2],
                                                                 [drag3,drop3],
                                                                 [drag4,drop4],
                                                                 [drag5,drop5],
                                                                 [drag6,drop6],
                                                                 [drag7,drop7]];
    //Enable all the stage items
    resetBtn.onRelease = function()
              resetAll();
    submitBtn.onRelease = function()
              if(evaluateAnswers())
                        feedbackTxt.text = correctFeedback;
              else
                        feedbackTxt.text = incorrectFeedback;

    Here is an alternate link to the source / .fla file  - orig link was not to my public dropbox!
    https://www.dropbox.com/home#:::68035214
    or
    https://skydrive.live.com/?cid=bb539b6eff0afbf5&sc=documents&id=BB539B6EFF0AFBF5%21124#

  • I've found a bug in drag and drop in responsive projects

    I've created a simple, one slide project which has two sources and four targets. Before running the drag and drop wizard, the project previews and publishes. Once I've added the drag and drop wizard, it never previews nor publishes.
    Any ideas anyone?

    Having checked out D&D in responsive projects and did not see that problem.
    Maybe something got wrong when you updated? Did you delete the folders
    Layout, Preferences and Sample projects as instructed?

  • AS2 Drag and Drop interactive exercise widget - Captivate 4

    Hello,
    I need an Actionscript 2 widget to create drag and drop exercises. Can anyone tell me where I can find a good one?
    Thanks!

    Is there a specific reason why you can't output your project to AS3?
    If you can use AS3 there are two Infosemantics Drag and Drop widgets you can choose from.
    I don't know of any drag and drop widgets in AS2.

  • Multiple drag-and-drop completely broken in Mail 4.2

    I've noticed this since I first installed Snow Leopard, but it's now becoming too annoying to ignore.
    If I try to select multiple emails from my MobileMe inbox and drag them all at once to a folder in the MobileMe account, it only drags a single email. Thus, moving 10 emails requires dragging and dropping 10 times.
    This showed up as soon as I installed Snow Leopard.
    Does anybody have a work around or other advice?
    Is this a know issue?
    Thanks.

    causes mine to crash.
    'SnowCrash'?

  • AS2 drag and drop a masked content from loadMovie clip

    In the main content, when I have a movie clip like this   a1.a2.a3 while  a3 inside a2 and a2 inside a1, and a2 is a masked layer movie clip.
    I can drag and drop the masked content (while a1 stay still) with like this   a1.a2.onPress = function () { startDrag(this); }  and a1.a2.onRelease = function () { stopDrag(); }
    but then what i need is a1 stay in main content, while moved a2.a3 to an external .swf, and use loadMovie to put .swf(a2.a3) back into a1, and I can still drag/drop a2.a3 when a1 stay still.
    I tried differetn methods they all not working.  I've learned that you need to create another MC inside a1 like this a1.a4.a2.a3 ( while a2.a3 from loadMovie clip). it only work if I want to drag a1. but if I want to drag masked content a2.a3 it still doesn't.
    I really need help it's a project for work.

    if I apply drag to a1.a4 , it will still move the whole thing but not just masked content which is in a2.a3
    I pretty much given up on this one at this point..   gonna just throw everything into just one big swf save the struggling time,
    but thank  you for your input.

  • Embedded drag and drop not working

    Hi,
    Hoping someone can help as have got 90% of the way through a project and hit a wall at the final (end-of-level-baddie) problem.
    I'm currently embedding old AS2 activities (build by a second party - now not operating/contactable) into a new AS3 menu system.
    Most of them I've managed to port across and embed without issue. Unfortunately embedding the drag and drop activity is proving to be, for want of a better phrase, a complete drag.
    I've managed to decompile the code, so have put a few trace statements in to find out what might be going wrong. Looking in the collision detection part of the code, the problem appears to be that when the activity is embedded, although the index of the drag clip is returned fine with its corresponding index number, the index of the drop clip is returned as 'undefined'.
    The activity works fine in a standalone flash player, with both indexes returning their respective numbers. However not so when it's embedded.
    I'm guessing that this is a levels issue, but is there any easy way that I can force the AS2 drag and drop game to act as self-contained and ignore its parent holding clip?
    Thanks in advance

    Hi kglad,
    Thanks for replying (you've helped me out before :-)  )
    A search of the classes reveals only one mention of getDepth() on a text field, which is irrelevant at the mo (as the engine's just creating image drag and drops)
    The main activity stage is created by an EngineClass (which drives all the activities I've been adapting, but wasn't a problem with less layer critical ones).
    There are three lines I can see where the activity stage is created using 'getNextHighestDepth()'
    this.mWhere.createEmptyMovieClip("activity_mc", this.mWhere.getNextHighestDepth());
    this.mWhere.createEmptyMovieClip("activityMask_mc", this.mWhere.getNextHighestDepth());
    this.mWhere.createEmptyMovieClip("toolbars_mc", this.mWhere.getNextHighestDepth());
    All the drags and drops are then created within this activity_mc. When I run the activity as standalone (where it works), and drag an item onto a drop zone, the traces I set up on the Drag and Drop items report back the following:
    DragObject: _level0.activity_mc.container_mc.dropItem2.dropSkin.greyBorder.whiteBG
    DropArea: _level0.activity_mc.container_mc.dropItem2.dropSkin.greyBorder
    When I run it embedded in the AS2 wrapper it then fires back the following after an attempted drop:
    DragObject: undefined
    DropArea: undefined
    ...and the item refuses to drop on the dropzone, returning to where it came from.
    The tiny amount of knowledge I have makes me (probably mistakenly) assume that if I could place the activity_mc layer on root, then everything would be contained within the embedded clip and the layering wouldn't go so wonky. But in reality I've got no idea! To make matters worse, the original drag and drop activity is itself inside another as2 wrapper which contains some navigation buttons...

  • 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

  • Drag and drop to grid AS2

    i want to create a grid where i can drag and drop items to it n save them, should i draw the grid myself and make a bunch of holders (as if i were making an inventory?) or is there a code i can use.
    i am pretty good with as2 but i never took the time to really get into arrays. i come up with my own solutions, but i want to make this the right way.
    for ex.sims build mode. 
    anyone interested in helping me out with my game also?  Doesnt hurt to ask.

    that doesn't sound like drag and drop.
    but if you want to attach something to a clicked cell, just do it.  flash will know which cell was clicked the same way it knows which button in a list of several buttons were clicked:
    for(var i:Number=0;i<colNum;i++){
    for(var j:Number=0;j<rowNum;j++){
    var mc:MovieClip=this.attachMovie("cell_mc","cell_"+j+"_"i,this.nextHighestDepth());
    mc.colNum=j;
    mc.rowNum=i;
    mc._x=j*mc._width;
    mc._y=i*mc._height;
    mc.onRelease=function(){
    //do whatever

  • Drag and Drop- Can it be used in a responsive project?

    The drag and drop interaction is not clickable in a responsive project, is there a way I can still use it? I have tried to copy and paste it, but it doesn't work very well...

    Drag & Drop is not yet possible in Responsive Projects: Top issues | Adobe Captivate 8
    Lilybiri

  • Is the drag and drop interaction available for responsive projects in Cp8?

    I created a responsive course but the Drag and Drop button is not active. Is the drag and drop interaction available for responsive projects in Cp8?
    Thanks

    Not yet available for responsive projects.
    On Jul 14, 2014 10:31 PM, "EWC_elearningDev" <[email protected]>

  • How can i let a move clip complete his motion tween movement after dragging and dropping it

    hi how can i let a move clip complete his motion tween movement after dragging and dropping it
    i am using this code and there is a motion tween applies to the movie clip r_mc
    r_mc.addEventListener(MouseEvent.MOUSE_DOWN,fun); r_mc.addEventListener(MouseEvent.MOUSE_UP,fun2); function fun(event:MouseEvent):void { stop(); r_mc.startDrag();
    function fun2(event:MouseEvent):void {
    play(); r_mc.stopDrag();

    i have a simple .fla file wich contains MC that has
    a motion tween(its moving from the left to the right of the stage)
    this motion tween covers the whole time line (  there is only 50 frames in the time line)
    i mean in the frame 1 the MC appears in the left of the stage
    and in the frame 50 the MC appears in the right of the stage and there is a motion tween between them
    every thing till now working well
    i want to make that MC dragabble
    so when i drag the MC i will use stop()
    and when i drop it i will use play()
    but the problem is that the mc doesnt move and complete
    his motion tween movement when i drop it
    for example the MC will be in the middle of the stage in frame 25
    in this frame (25) i am draging the MC ,stoping the timeline,dropping the MC and resum playing the timeline again
    but the MC freezes in the middle of the stage and doesnt go to the right of the stageo until the flash loops and start from the frame 1 again
    here is the example wich i am worikng on
    http://www.mediafire.com/?ia47r4owha7sz8v
    thank u very much and sorry for my bad English

  • Help Converting AS2 to AS3 Drag and Drop Event

    Hi All,
    This is the second post on help for converting AS2 to AS3. This code is used in Captivate to allow a drag and drop action between two areas (User presses down, drags, and releases in a second area - They are not dragging any object). If anyone can help me convert this please let me know.
    Source for Drag and Drop: (Note: Single MovieClip)
    // pause the Captivate movie
    _root.rdcmndPause = 1;
    // when the user's mouse is let go check if there was a successful drop
    _root.onMouseUp = function(){
              // If the source area's center coordinate is nearby the destination area's center coordinate then advance the slide
              if ( Math.abs(_root.sourceX + _root.sourceWidth  / 2 + _root.sourceParentX - (_root.destX + _root.destWidth  / 2)) < (_root.destWidth  / 2) &&
                         Math.abs(_root.sourceY + _root.sourceHeight / 2 + _root.sourceParentY - (_root.destY + _root.destHeight / 2)) < (_root.destHeight / 2) )
                        _root.rdcmndNextSlide = 1;
              } else {
                        // show error movie clip for 2 seconds (60 frames at 30 frames per second)
                        _root.showErrorMessage = 60;
      mc.onEnterFrame = function(){
              // continuously update the source area's coordinates and size
              _root.sourceX = mc._x;
              _root.sourceY = mc._y;
              _root.sourceWidth = mc._width;
              _root.sourceHeight = mc._height;
              _root.sourceParentX = _parent._x;
              _root.sourceParentY = _parent._y;
    mc.onPress = function(){
              // Uncomment following line to have control click capabilities
              //if(key.isDown(Key.CONTROL))
              // when user clicks on the source area click start the drag
                        startDrag(this);
    mc.onRelease = function(){
              // stop drag when user releases the source area
              stopDrag();
    Source for Destination Area (Single MovieClip named destArea)
    // Set a root variable to control when the error message is displayed
    _root.showErrorMessage = -1;
    // Use setCoords variable so we only set the destination coordinates once
    var setCoords = 0;
    destArea.onEnterFrame = function(){
              if (setCoords == 0){
                        // set the destination x, y, width, and height
                        _root.destX = _parent._x;
                        _root.destY = _parent._y;
                        _root.destWidth = _parent._width;
                        _root.destHeight = _parent._height;
              // destination coordinates have been set, change setCoords so it doesn't get set again
              setCoords = 1;
    Code for the Error Message (Single MovieClip named errorMessage)
    // Don't display the error message initially
    errorMessage._alpha = 0;
    errorMessage.onEnterFrame = function (){
              // If the drag and drop method detects a missed drop
              // then show this error message by setting _alpha to 100
              if (_root.showErrorMessage > 0){
                        errorMessage._alpha = 100;
                        // decrementing this variable controls the time the
                        // error message will be displayed
                        _root.showErrorMessage--;
              } else {
                        // Don't display the error message
                        errorMessage._alpha = 0;

    use:
    MovieClip(parent.parent.parent).rdcmndPause=1;
    this.addEventListener(KeyboardEvent.KEY_DOWN,keydownF);
    function keydownF(e:KeyboardEvent):void{
    fscommand("KEYPRESSED", e.keyCode);
    if(e.keyCode==32){
    MovieClip(parent.parent.parent).rdcmndNextSlide=1;

  • Drag and Drop with a response in Flash..please help

    Hi
    I have just started with flash and actionscript3 about 5 weeks ago. I'm in my first year uni and I have a drag and drop assignment (for a kindergarten class). Its "little Red Hen" and they have place the correct picture in right holder.
    I have gotten the drag and drop working but I can't seem to figure out how to display a tick when they have place it in the correct holder.
    Please help....
    This is my script (it may seem messy...still new)
    import flash.events.MouseEvent;
    /*Mouse Event that ensures the function of hen movieclip to start dragging
      when mouse is pressed*/
    hen1_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart);
    hen2_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart);
    hen3_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart);
    hen4_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart);
    hen5_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart);
    hen6_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragStart);
    function dragStart (event: MouseEvent):void
        event.target.startDrag();
    /*Mouse Event that ensures the function of hen movieclip to drop
    when the mouse button is realeased with Condition statement, if
    hen = holder, hen snaps into place*/
    hen1_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop1);
    function dragStop1 (event:MouseEvent):void
        hen1_mc.stopDrag();
        if (hen1_mc.hitTestObject (holder1_mc)==true)
            hen1_mc.x=holder1_mc.x;
            hen1_mc.y=holder1_mc.y;
    hen2_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop2);
    function dragStop2 (event:MouseEvent):void
        hen2_mc.stopDrag();
        if(hen2_mc.hitTestObject (holder2_mc)==true)
            hen2_mc.x=holder2_mc.x;
            hen2_mc.y=holder2_mc.y;
    hen3_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop3);
    function dragStop3 (event:MouseEvent):void
        hen3_mc.stopDrag();
        if(hen3_mc.hitTestObject (holder3_mc)==true)
            hen3_mc.x=holder3_mc.x;
            hen3_mc.y=holder3_mc.y;
    hen4_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop4);
    function dragStop4 (event:MouseEvent):void
        hen4_mc.stopDrag();
        if(hen4_mc,hitTestObject (holder4_mc)==true)
            hen4_mc.x=holder4_mc.x;
            hen4_mc.y=holder4_mc.y;
    hen5_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop5);
    function dragStop5 (event:MouseEvent):void
        hen5_mc.stopDrag();
        if(hen5_mc.hitTestObject (holder5_mc)==true)
            hen5_mc.x=holder5_mc.x;
            hen5_mc.y=holder5_mc.y;
    hen6_mc.addEventListener(MouseEvent.MOUSE_UP, dragStop6);
    function dragStop6 (event:MouseEvent):void
        hen6_mc.stopDrag();
        if(hen6_mc.hitTestObject (holder6_mc)==true)
            hen6_mc.x=holder6_mc.x;
            hen6_mc.y=holder6_mc.y;

    Ok so I figured it out, thank you Ned.
    I have made the tick_mc alpha 0 in the beginning of the script and then in my conditional I have made the alpha = 100
    So it works...yay!
    Now all I have left, if the piece is placed in the wrong holder then it needs to go back into its orignal position.
    I have tried
    Written above the script
    var startX:Number;
    var startY:Number;
    then just below my dragStart code
    startX = event.target.x = startX;
    startY = event.target.y = startY;
    then after each if statement I placed an else statement
    else
          hen1_mc.x = startX;
          hen1_mc.y = startY;
    Its clearly not working, please could you tell me what I am doing wrong?
    thank you

  • Drag and Drop with snap and response

    Ok, first of all I'm new to all of this as I'm just doing some parttime work. I'm trying to make a drag and drop game where the images (imported and made into movie clips with instance names "peg1 - peg7") are to be dragged onto targets (images, made into movie clips with instance names "targetpeg1-targetpet7").
    Here's my code and it comes up with two errors -
    ReferenceError: Error #1069: Property parent not found on builtin.as$0.MethodClosure and there is no default value.
    at Gametake1_fla::MainTimeline/fl_ReleaseToDrop()
    Please help!!! Thanks a bunch!
    Amy
    peg1.buttonMode = true;
    peg2.buttonMode = true;
    peg3.buttonMode = true;
    peg3.buttonMode = true;
    peg4.buttonMode = true;
    peg5.buttonMode = true;
    peg6.buttonMode = true;
    peg7.buttonMode = true;
    peg1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg2.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg3.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg4.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg5.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg6.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg7.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    function fl_ClickToDrag(event:MouseEvent):void
    event.currentTarget.startDrag();
    reply_txt.text = "Drag the image to its correct location"
    peg1.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg2.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg3.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg4.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg5.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg6.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg7.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    function fl_ReleaseToDrop(event:MouseEvent):void
    event.currentTarget.stopDrag();
    var myTargetName:String = "target" + event.target.name;
    var myTarget:DisplayObject = getChildByName("myTargetName");
    if (event.target.stopDrag != null && event.target.stopDrag.parent == myTarget){
        reply_txt.text = "Good Job!";
    } else {
        reply_txt.text = "Try Again!";
    function checkTarget(drag){
    if (drag.hitTest(targetpeg1)) {
    trace(drag+" has been dropped on greyCircle");
    } else {
    trace("you missed the target");

    use:
    peg1.buttonMode = true;
    peg2.buttonMode = true;
    peg3.buttonMode = true;
    peg3.buttonMode = true;
    peg4.buttonMode = true;
    peg5.buttonMode = true;
    peg6.buttonMode = true;
    peg7.buttonMode = true;
    peg1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg2.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg3.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg4.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg5.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg6.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    peg7.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    function fl_ClickToDrag(event:MouseEvent):void
    event.currentTarget.startDrag();
    reply_txt.text = "Drag the image to its correct location"
    peg1.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg2.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg3.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg4.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg5.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg6.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    peg7.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);
    function fl_ReleaseToDrop(event:MouseEvent):void
    event.currentTarget.stopDrag();
    var myTargetName:String = "target" + event.currentTarget.name;
    var myTarget:DisplayObject = getChildByName("myTargetName");
    if (event.currentTarget.dropTarget){
    if(event.currentTarget.dropTarget.parent == myTarget){
        reply_txt.text = "Good Job!";
    } else {
        reply_txt.text = "Try Again!";

Maybe you are looking for

  • NiRFSG_CheckGenerationStatus fails periodically

    Hello: I keep observing this strange effect once in a while with my 3 channel PXI-5673 system. Just to make it clear - I have yet to find a way to reproduce this problem. NI-RFSG 1.6.3. There are three generators, daisy chained. I set them to generat

  • Why Does Photoshop cs5 Camera RAW not open CRW files

    I need help bad.I am running Windows XP Pro.I had to get Adobe help to install a update to photoshop to get it to open.That part is working.Yesterday I tried to go thru some of my CRW Raw negatives,They will not open in camera raw or bridge or mini b

  • .docx no longer opening on my iPad air, when I could open them before?

    i Have had .docx file types sent to me as recent as September 2014, which I could open simply by tapping on the attachment. Now October 2014, they will not open? Why? can this by changed back to all me to open the .docx which I have attached to mail

  • Bapi for T-Code:fbs1

    I want to creat documents by bapi:BAPI_ACC_DOCUMENT_POST.Sometime interface want to tell reversal date,but this FM has no this parameter(only reversal reason). Thanks!

  • Album uploaded to my Photoshop web site does not appear in album order

    Album uploaded to my Photoshop web site does not appear in album order, although after it is configured through the sharing function, it is in the correct order.