HELP! Why does my Drag and Drop not work Completely?

Hello! I'm working on an ActionScript 3 movie clip in Adobe Flash. In the interactive movie I want the user to create a snowman with the parts on the left side. (Picture below.)
On the right side I have the snowman slightly visible, so the user knows where to put the parts. Most of it seems to work... but after I put on the body, hat, and arms the other pieces don't work; like the eyes, nose, mouth, etc. Why does it not work? Can someone help me?
This is how it should look at the end, when the user complets it.
I think I coded this correctly. But I'm not sure. Please take a look at my code and see what the problem is. Thanks!!!
var startX:Number;
var startY:Number;
var counter:Number = 0;
SNOWMAN1_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
SNOWMAN1_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
SNOWMAN2_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
SNOWMAN2_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
SNOWMAN3_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
SNOWMAN3_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
LEFTARM_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
LEFTARM_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
HAT_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
HAT_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
RIGHTARM_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
RIGHTARM_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
SCARF_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
SCARF_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
EYES_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
EYES_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
MOUTH_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
MOUTH_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
CARROT_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
CARROT_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
COLE1_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
COLE1_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
COLE2_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
COLE2_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
COLE3_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
COLE3_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function pickUp(event:MouseEvent):void {
event.target.startDrag(true);
MYTEXTBOX.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 = "T" + event.target.name;
var myTarget:DisplayObject = getChildByName(myTargetName);
if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
MYTEXTBOX.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 {
MYTEXTBOX.text = "Try Again!";
event.target.x = startX;
event.target.y = startY;
if(counter == 13){
        MYTEXTBOX.text = "Congrats, you're finished!";
SNOWMAN1_mc.buttonMode = true;
SNOWMAN2_mc.buttonMode = true;
SNOWMAN3_mc.buttonMode = true;
LEFTARM_mc.buttonMode = true;
HAT_mc.buttonMode = true;
RIGHTARM_mc.buttonMode = true;
SCARF_mc.buttonMode = true;
EYES_mc.buttonMode = true;
MOUTH_mc.buttonMode = true;
CARROT_mc.buttonMode = true;
COLE1_mc.buttonMode = true;
COLE2_mc.buttonMode = true;
COLE3_mc.buttonMode = true;

Below is a more efficient code. I am not sure about chasing parents you do in the code (always bad idea) so this code may be buggy:
var startX:Number;
var startY:Number;
var counter:Number = 0;
// reference to currently dragged object
var currentTarget:Sprite;
var objectCollection:Array = [SNOWMAN1_mc, SNOWMAN2_mc, SNOWMAN3_mc, LEFTARM_mc, HAT_mc, RIGHTARM_mc, SCARF_mc, EYES_mc, MOUTH_mc, CARROT_mc, COLE1_mc, COLE2_mc, COLE3_mc];
activateObjects();
function activateObjects():void {
     for (var i:int = 0; i < objectCollection.length; i++) {
          currentObject = objectCollection[i] as Sprite;
          currentObject.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
          currentObject.buttonMode = true;
function pickUp(event:MouseEvent):void {
     currentTarget = event.currentTarget as Sprite;
     currentTarget.startDrag(true);
     MYTEXTBOX.text = "";
     currentTarget.parent.addChild(currentTarget);
     startX = currentTarget.x;
     startY = currentTarget.y;
     stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function dropIt(event:MouseEvent):void {
     stage.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
     stopDrag();
     var myTarget:DisplayObject = getChildByName("T" + currentTarget.name);
     if (currentTarget.dropTarget != null && currentTarget.dropTarget.parent == myTarget){
          MYTEXTBOX.text = "Good Job!";
          currentTarget.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
          currentTarget.buttonMode = false;
          currentTarget.x = myTarget.x;
          currentTarget.y = myTarget.y;
          counter++;
     } else {
          MYTEXTBOX.text = "Try Again!";
          currentTarget.x = startX;
          currentTarget.y = startY;
     if (counter == 13) MYTEXTBOX.text = "Congrats, you're finished!";
     currentTarget = null;

Similar Messages

  • Why is my drag and drop not working

    I have Mac OS X 10.5.8 and my copy paste has quit working as well as my drag and drop. Any help would be much appreciatd.

    Hi ccfair,
    Welcome to the Apple Support Communities! I understand that you are experiencing some issues with your MacBook running OS X 10.5.8. Let’s see if we can isolate these issues further by testing in a new user account:
    Isolating an issue by using another user account - Apple Support
    https://support.apple.com/en-us/TS4053
    - Matt M.

  • Why does drag and drop not work?

    Why does drag and drop not work?

    Do you mean that when you move files on the Desktop, they don't stay where you put them ?.
    If so - use Finder - View menu - Show View options & choose 'Arrange by' : none
    If not - please describe exactly what the problem is.

  • Drag and drop not working.  When trying to move a cell or icon the shadow of the cell or icon being moved appears under the cursor but can't be released causing a freeze of function within the program.  Happens in finder numbers and firefox

    Drag and drop not working.  When trying to move a cell or icon the shadow of the cell or icon being moved appears under the cursor but can't be released causing a freeze of function within the program.  Happens in finder numbers, firefox, and when trying to move any file from the downloads folder.
    This is a serious pain.
    Please help.
    WB

    Yes, all I can tell you is that Finder does not have that function in ML. Your system is "working as expected".
    You can file feedback here.

  • Drag and Drop not working since last software update

    Drag and Drop not working since last software update - this is occuring on Outlook for the mac and I just tried moving  an icon on the doc and the same thing occured.  YOu can drag but the items will not drop.

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins and log in as Guest. For instructions, launch the System Preferences application, select Help from the menu bar, and enter “Set up a guest account” (without the quotes) in the search box.
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem(s)?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    Note: If you’ve activated “Find My Mac” or FileVault in Mac OS X 10.7 or later, then you can’t enable the Guest account. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. The instructions provided by Apple are as follows:
    Be sure your Mac is shut down.
    Press the power button.
    Immediately after you hear the startup tone, hold the Shift key. The Shift key should be held as soon as possible after the startup tone, but not before the tone.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem(s)?
    After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of steps 1 and 2.

  • PowerMac 5.1 drag and drop not working, any suggestions?

    Powers Mid 2010 5.1 running 10.10.3, drag and drop not working smoothly, won't engage to drag. Any suggestions?

    Thanks for the return, well, just trying to relocate a web screen or move a saved application from the desktop into a folder. I use Final Cut Pro Ten extensively and sometimes I want to drag something off my desktop into the time line on the FCPX. When I left click and hold on the item to drag it doesn't seem to engage then when it does move it quits along the way to the drop point. I hope that makes since too you? I use a Logitech two button with a scroll wheel wired mouse and have twin 32" monitors. Thanks Latranner

  • Field list on/off drag and drop not working in smartforms

    Hello Friends,
    field list on/off drag and drop not working in smartforms.
    is there any settings or some components needs to be activated ??
    i can drag the fields from the list but when i drop in the text node its not dropping tht field.
    Regards,
    Sunny

    Hi Friends,
    Even I am facing the same problems. What is the solutions for this ?
    And may I know what software version (sap gui) are you using.

  • HT203175 drag and drop not working desperate for help

    Can you possibly help me with my drag and drop?
    All of a sudden itunes won't let me drag purchased tracks or tracks from library on to my ipod. I have read you need to make sure you have checked manually manage music and videos and I have done that. It worked one minute and now has stopped. I don't understand why drag and drop has just been fine then suddenly stopped working.
    Thanks.

    Oh right... All my devices are on the SAN and have been set as edit-in-place. The files in question were copied from the regular media watch folder to the media device. So basically just one folder on the SAN to another.
    It has to be more than just the watcher, because two of the files in question were added by a subscription response that has worked fine for me before.
    Thanks,
    Mario

  • Drag and Drop not working with windows 8.1

    we using windows 8.1 for a few days now
    so we installed visual basic .net 2012 and starting our projects again we used in windows 7
    but now it seems that the drag and drop doesn't work in windows 8.1
    we only gets a forbidden icon when we drag it over the control
    please can someone tell us why windows 8.1 won't work with drag and drop
    we hope this can be fix in anyway because we don't like when our users use our programs
    and tell us that this point wont work in windows 8.1
    our code:
    Private Sub FlowLayoutPanel1_DragDrop(sender As Object, e As DragEventArgs) Handles FlowLayoutPanel1.DragDrop
    If (e.Data.GetDataPresent(DataFormats.FileDrop)) Then
    e.Data.GetData(DataFormats.FileDrop)
    End If
    End Sub
    Private Sub FlowLayoutPanel1_DragEnter(sender As Object, e As DragEventArgs) Handles FlowLayoutPanel1.DragEnter
    Try
    If (e.Data.GetDataPresent(DataFormats.FileDrop)) Then
    e.Effect = DragDropEffects.Copy
    Else
    e.Effect = DragDropEffects.None
    End If
    Catch ex As Exception
    Exit Sub
    End Try
    End Sub
    Thank you.
    Dummy
    p.s
    we also got help from social msdn
    here the topic who all answered.
    social
    mdsn

    Hi,
    Welcome posting in TechNet forum.
    Do you mean the drag and drop action of files within different application?
    We may take a try to disable the UAC settings and see if the drag and drop would work. And please note if we have UAC disabled, Windows Store APPs would be expected not going to work.
    For the coding edit stuff, I suggest we keep focus on the MSDN thread.
    Best regards
    Michael Shao
    TechNet Community Support

  • Drag and drop not working when uploading file using safari

    why i cannot drag and drop any file when using safari , and what happens the file auotmatically open while i need to upload it only , extra for that , i cannot write  any remark or fill a space while using website related to my work.
    my work is to upload drawing files using dwf file to a website so the other parties can review and give me review , and then i reply to the remark at the same place and make meeting through the same site.
    please any body can give any way to correct my mac.
    latelly i installed win7 only to use it for that website , and iam now changing from mac to win whenever i want to work , this not acceptable to me because it is waste of time beside i like the mac and it working with other application but not for safari.

    why ?
    I'm sorry, but every OS is different.  You cannot expect all features of one to be in another.  Or alternatively, for similar features, be done it the exact same way. 
    It looks to me after a quick google search that winexplorer is basically the moral equivalent of the mac's finder to present the file system in different ways.  The OSX Finder also has alternative views of the file system, i.e., icons, list, columns.  Experiment with the list and column views and see if one of them are more to your liking.
    As for winexplorer on the mac.  I don't know if this simulates it or not but there is a program called Macintosh Explorer so check that out as well.
    And finally, in the end, as I said in my earlier post, no matter what, nothing on the mac is going to change what I believe you think you can do and drop a file on a browser window and expect it to upload.

  • LR5.7, drag and drop not working...suggestions?

    Two days ago, drag and drop stopped working within lightroom (dragging a photo/photos from the filmstrip at the bottom to a different folder, or into a collection).  The cursor on the screen stays an arrow when you click on a photo and hold the left mouse button down, it will highlight the image in the filmstrip or grid view, but will not do anything with it.  I've never had anything like this happen before.  iMac, 32gb ram, OSX 10.10.1, LR5.7.

    Paul,
    ok, standard support question on Windows: Does this also occur after reboot?
    And my question refers to the right click >> Run as administrator option. It was not the question if your login has administrative rights.... sorry for the confusion.
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Why does the drag and drop feature not work?

    I have several files on my desktop.  When I try to move them o a new location, they just 'snap back' to their original position.  Why doesn't the drag and drop feature not function properly?

    I'm just trying to move some files to a new position on the desktop.

  • Why does the drag and drop context menu always popup when dragging files between windows explorer instances ?

    I have fusion 7.1.1 on an iMac 27 inch retina. 32GB ram of which 6GB assigned to Fusion and 2 cores. Windows 7 Home Premium installed. Mostly working fine but a few funnies. First and foremost: Whenever I drag and drop between instances of windows explorer, I get the little pop-up context menu offering me Copy Here / Move Here etc.  etc. I have never known Windows to ask me what I want to do when I drag stuff - why is this happening ? I have scoured the net for info on this and found nothing. Please note that this is NOT associated with the Start Menu (For which I found a zillion solutions to whatever that problem is). Also, It is NOT to do with stopping drag & drop and Context menus: yes, I know how to do that but that is NOT what I'm asking to get rid of. This may not be related but I have also had to set my Internet Properties / Explorer settings / Launching-applications-and-unsafe-files to "Enable" to prevent every shortcut I create causing a "Do you want to run this ... ?" message every time I click on them. Doing this has caused WIndows 7 to turn into a finger-wagging safety-nanny glaring at me over its demi-lune spectacles.

    Ok ... fixed
    Here is the way http://forums.creativecow.net/thread/3/944828
    In your sequence, on the left most column you should see a V1 (left of the Lock Track button). Click that to make sure its highlighted, it allows you to drop video to the sequence.

  • Why is drag and drop not working in lion

    Drag and drop has not worked correctly once since I started using lion.

    Hi
    I had the same problem in my case the remedy was simple
    Preferences - Universal Access - Mouse and Trackpad tab - trackpad options
    tick the drag and drop box
    I dont know why this option had been turned off but ticking this box restored the drag and drop function
    HTH

  • Drag and Drop not working with spark HGroup with code

    Can anyone tell me why my HGroup won't fire the dragEnter dragDrop and DragOver events?
    Here is the sample code:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import mx.core.IUIComponent;
                import mx.events.DragEvent;
                import mx.managers.DragManager;
                private function dragEnterHandler(e:DragEvent):void {
                    DragManager.acceptDragDrop(e.currentTarget as IUIComponent);
                private function dragOverHandler(e:DragEvent):void {
                    DragManager.showFeedback(DragManager.COPY);
                //user drops src onto target, so re-parent the src to the target
                private function dragDropHandler(e:DragEvent):void {
                    var img:Image = e.dragInitiator as  Image;
                    var newImg:Image = new Image();
                    newImg.load(img.source);
                    var grp:HGroup = e.currentTarget as HGroup;
                    grp.addElement(newImg);
                private function mouseDownHandler(e:MouseEvent):void {
                    DragManager.doDrag(e.currentTarget as IUIComponent, null, e);
            ]]>
        </fx:Script>
        <s:layout>
            <s:HorizontalLayout />
        </s:layout>
        <s:Panel width="50%" height="100%" title="Drag me">
            <mx:Image source="http://www.google.com/intl/en_ALL/images/logo.gif" mouseDown="mouseDownHandler(event);" />
        </s:Panel>
        <s:Panel width="50%" height="100%" title="to Here">
            <s:HGroup width="100%" height="50%" dragEnter="dragEnterHandler(event);" dragDrop="dragDropHandler(event);"  dragOver="dragOverHandler(event);" />   
            <s:HGroup width="100%" height="50%" dragEnter="dragEnterHandler(event);" dragDrop="dragDropHandler(event);"  dragOver="dragOverHandler(event);" />   
        </s:Panel>
    </s:Application>

    Derek,IE11 is having some compatibility issues with the share point.Apart from IE11,it should work on IE10,9 and Firefox and chrome as well.
    Please check the links below that explains the issues with IE11 and the functionality of Drag and drop and limitations as-well.
    1.Since SharePoint 2013 fully support IE 32-bit version above 7, there might be compatibility issue with other browsers. I’d recommend you use IE 8,9,10 32-bit for optimal Performance.
    2. Open the same document library in Internet Explorer as this functions does not work with Firefox or Chrome by default
    3. Make sure the IE (Internet Explorer) Version should be 32-bit and not a 64-bit
    http://expertsharepoint.blogspot.de/2014/08/issues-with-sharepoint-2013-and.html
    http://expertsharepoint.blogspot.de/2013/12/how-to-upload-multiple-documents-in.html
    http://expertsharepoint.blogspot.de/2013/12/sharepoint-server-2013-drag-and-drop.html
    Anil Avula[Partner,MCP,MCSE,MCSA,MCTS,MCITP,MCSM] See Me At: http://expertsharepoint.blogspot.de/

Maybe you are looking for

  • Home Sharing not working between wireless PC's / devices and ethernet wired PC's on the same router.

    Home Sharing is not working between wireless PC's / devices and ethernet wired PC's on the same router.  I installed a new Verizon FIOS ActionTec  MI424WR GigE wireless / ethernet router, replacing the original FIOS router.  With the old router Home

  • Error message in iTunes app when downloading movies

    I have this error in the iTunes app that whenever I try and restart a download it seems to not download the file properly and gives me the wrong amount of time it will take to download the movie to my phone and then fails to download the movies sayin

  • Lock on Purchase Order to pass budget

    Good afternoon, I'm trying to make a lock for documents representing purchase, I started working on it, basing on the purchase order, this restriction should say already on step budget and can not generate the purchase order, but can not find how to

  • TCURX not updating in BW with RSIMPCUST

    BW Dudes and Dudettes, Our ECC6 com padres have deleted an entry from TCURX. They've done this in the ECC6 environment (Dev currently, but QA and Prod to follow). I now want to replicate the change to BW. I've used all the options on RSIMPCUST manual

  • Drop down menus and flash

    Here's the site: http://www.oldshoecreative.com/CLS/ In IE, I cannot seem to get the drop down menus to appear in front of the swf files that runs below them. I've tried the "wmode" and "transparent" settings which work fine in Firefox, but I can't g