Having Problem Adding to drag and drop to move furniture over a floor plan

I have the code which follows. I need to create floor plans where web visitors can drag and drop furniture onto the floor plan.  I have  three items that work but when I convert any additional items to a symbol and select movie clip and then add more lines to the code, none will work.. How can the code determine that  my movie clip I named "couch" is going to movie clip 4.  Thank you if you can help, Frankie Foster
Below is my code:
var numObjects:uint = 3  // assign the total number of movieclips that will be dragged
for(var i:uint=1; i<=numObjects; i++){
     this["movieClip_"+String(i)].addEventListener(MouseEvent.MOUSE_DOWN, clickToDrag);
     this["movieClip_"+String(i)].addEventListener(MouseEvent.MOUSE_UP, releaseToDrop);
var selectedMC:MovieClip;
movieClip_1.addEventListener(MouseEvent.MOUSE_DOWN, clickToDrag);
movieClip_2.addEventListener(MouseEvent.MOUSE_DOWN, clickToDrag);
movieClip_3.addEventListener(MouseEvent.MOUSE_DOWN, clickToDrag);
movieClip_1.addEventListener(MouseEvent.MOUSE_UP, releaseToDrop);
movieClip_2.addEventListener(MouseEvent.MOUSE_UP, releaseToDrop);
movieClip_3.addEventListener(MouseEvent.MOUSE_UP, releaseToDrop);
function clickToDrag(event:MouseEvent):void
     selectedMC = MovieClip(event.currentTarget);
     selectedMC.startDrag(); 
function releaseToDrop(event:MouseEvent):void
     event.currentTarget.stopDrag();
stage.addEventListener(KeyboardEvent.KEY_DOWN, nextQuestion);
function nextQuestion(event:KeyboardEvent):void {
      //trace(event.keyCode);
      if(event.keyCode == Keyboard.RIGHT)
           selectedMC.rotation += 5;
      if(event.keyCode == Keyboard.LEFT)
           selectedMC.rotation -= 5;

Your appear to have redundant coding assigning your listeners.  What code are you trying to add/modify to make the couch function like the others?
this...
for(var i:uint=1; i<=numObjects; i++){
     this["movieClip_"+String(i)].addEventListener(MouseEvent.MOUSE_DOWN, clickToDrag);
     this["movieClip_"+String(i)].addEventListener(MouseEvent.MOUSE_UP, releaseToDrop);
currently does what this also does....
movieClip_1.addEventListener(MouseEvent.MOUSE_DOWN, clickToDrag);
movieClip_2.addEventListener(MouseEvent.MOUSE_DOWN, clickToDrag);
movieClip_3.addEventListener(MouseEvent.MOUSE_DOWN, clickToDrag);
movieClip_1.addEventListener(MouseEvent.MOUSE_UP, releaseToDrop);
movieClip_2.addEventListener(MouseEvent.MOUSE_UP, releaseToDrop);
movieClip_3.addEventListener(MouseEvent.MOUSE_UP, releaseToDrop);

Similar Messages

  • Problems with ListViews Drag and Drop

    I'm surprised that there isn't an Active X control that can do this more
    easily? Would
    be curious to find out if there is - although we aren't really embracing the
    use of
    them within Forte because it locks you into the Microsoft arena.
    ---------------------- Forwarded by Peggy Lynn Adrian/AM/LLY on 02/03/98 01:33
    PM ---------------------------
    "Stokesbary, Michael" <[email protected]> on 02/03/98 12:19:52 PM
    Please respond to "Stokesbary, Michael" <[email protected]>
    To: "'[email protected]'" <[email protected]>
    cc:
    Subject: Problems with ListViews Drag and Drop
    I am just curious as to other people's experiences with the ListView
    widget when elements in it are set to be draggable. In particular, I am
    currently trying to design an interface that looks a lot like Windows
    Explorer where a TreeView resides on the left side of the window and a
    ListView resides on the right side. Upon double clicking on the
    ListView, if the current node that was clicked on was a folder, then the
    TreeView expands this folder and the contents are then displayed in the
    ListView, otherwise, it was a file and it is brought up in Microsoft
    Word. All this works great if I don't have the elements in the ListView
    widget set to be draggable. If they are set to be draggable, then I am
    finding that the DoubleClick event seems to get registered twice along
    with the ObjectDrop event. This is not good because if I double click
    and the current node is a folder, then it will expand this folder in the
    TreeView, display the contents in the ListView, grab the node that is
    now displayed where that node used to be displayed and run the events
    for that as well. What this means, is that if this is a file, then Word
    is just launched and no big deal. Unfortunately, if this happens to be
    another directory, then the previous directory is dropped into this
    current directory and a recursive copy gets performed, giving me one
    heck of a deep directory tree for that folder.
    Has anybody else seen this, or am I the only lucky one to experience.
    If need be, I do have this exported in a .pex file if anybody needs to
    look at it more closely.
    Thanks in advance.
    Michael Stokesbary
    Software Engineer
    GTE Government Systems Corporation
    tel: (650) 966-2975
    e-mail: [email protected]

    here is the required code....
    private static class TreeDragGestureListener implements DragGestureListener {
         public void dragGestureRecognized(DragGestureEvent dragGestureEvent) {
         // Can only drag leafs
         JTree tree = (JTree) dragGestureEvent.getComponent();
         TreePath path = tree.getSelectionPath();
         if (path == null) {
              // Nothing selected, nothing to drag
              System.out.println("Nothing selected - beep");
              tree.getToolkit().beep();
         } else {
              DefaultMutableTreeNode selection = (DefaultMutableTreeNode) path
                   .getLastPathComponent();
              if (selection.isLeaf()) {
              TransferableTreeNode node = new TransferableTreeNode(
                   selection);
              dragGestureEvent.startDrag(DragSource.DefaultCopyDrop,
                   node, new MyDragSourceListener());
              } else {
              System.out.println("Not a leaf - beep");
              tree.getToolkit().beep();
    }

  • How to change the effect of drag and drop from MOVE to COPY in alv tree.

    Hi,
    I am using a tool in which now the behaviour on drag and drop is MOVE. I want to change it to COPY.
    But I do not know which parameter needs to be set and where.
    please help.
    Regards,
    Smita.

    Hi,
    Thanks for quick reply.
    The code goes on like this
    METHOD set_dd_behavior.
      DATA: l_copysrc(1) TYPE c,
            l_movesrc(1) TYPE c,
            l_droptarget(1) TYPE c.
    Set the Drag and Drop Flavors.
      CREATE OBJECT dd_behavior.
      READ TABLE reg_functions WITH KEY name_function = 'COPY'
      TRANSPORTING NO FIELDS.
      IF sy-subrc = 0.
        l_copysrc = 'X' .
      ENDIF.
      READ TABLE reg_functions WITH KEY name_function = 'CUT'
      TRANSPORTING NO FIELDS.
      IF sy-subrc = 0.
        l_movesrc = 'X' .
      ENDIF.
      READ TABLE reg_functions WITH KEY name_function = 'PASTE'
      TRANSPORTING NO FIELDS.
      IF sy-subrc = 0.
        l_droptarget = 'X' .
      ENDIF.
      CALL METHOD dd_behavior->add
      EXPORTING
      flavor = 'MOVE'
      dragsrc = l_movesrc
      droptarget = l_droptarget
      effect = cl_dragdrop=>move.
      CALL METHOD dd_behavior->add
      EXPORTING
      flavor = 'COPY'
      dragsrc = l_copysrc
      droptarget = l_droptarget
      effect = cl_dragdrop=>copy.
      CALL METHOD dd_behavior->get_handle
      IMPORTING handle = dd_behavior_handle.
    ENDMETHOD.
    Here what changes needs to be done.
    As I see once COPY is added and next time MOVE is added.
    I am able to check because I am not able to edit while debugging the value of effect.
    Please suggest.
    Warm regards,
    Smita.

  • When moving a file using drag and drop, as I hover over the destination folder it no longer opens, so I can't drop the file into the folder.  Why?

    When moving a file using drag and drop, as I hover over the destination folder it no longer opens, so I can't drop the file into the folder.  Why?  I have a heirarchical embedded folder structure under \Documents.  Usually, as I drag the file to be moved over the various folders, they will blink twice, then expand/open to reveal contents (in Finder).  Now, when the file to be moved is held (hovering) over the destination folder, it will not blink or expand, so there's no place to drop the file.  If I release the mouse button, the file image disappears, showing that it is "going back to the place it came from", a.k.a. was not moved.  This just started happening.  I noticed it after upgrading to Mavericks.  Is this a bug or could anything else be causing this?

    As of today, Apple Support discovered during a remote support session with me that the same thing happens on their own system.  It is isolated to "Column View"; the Icon and List views in Finder behave correctly.  Issue is being escalated to engineering, and Apple will call to report status in a couple days.  In all likelihood, this is a bug that will need to be addressed in a future update.

  • DRAG AND DROP, OR MOVE MAIL TO NEW SMART MAIL?

    HI,
    I DO NOT SEEM TO BE ABLE TO DRAG AND DROP OR MOVE OLD MAIL INTO NEW SMART LOCATIONS?
    CYFROMAYO

    Smart mailboxes are not storage locations. They are simply a kind of remembered search. You cannot put things in those mailboxes, they simply show anything found in other mailboxes that matches the criteria you defined.

  • Problem Cursor disappears / Drag and Drop doesn't work

    Hey everybody,
    I have an urgent problem!
    Three butterflies are supposed to be dragged in an object.  My customized cursor is sort of a landing net to catch these butterflies.
    For the cursor I have this code:
    cursor_mc.startDrag("true");
    Mouse.hide();
    My drag and drop code is:
    cursor_mc.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    redbutterfly_mc.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    violetbutterfly_mc.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    yellowbutterfly_mc.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
    cursor_mc.addEventListener(MouseEvent.MOUSE_UP, stopMove);
    redbutterfly_mc.addEventListener(MouseEvent.MOUSE_UP, stopMove);
    violetbutterfly_mc.addEventListener(MouseEvent.MOUSE_UP, stopMove);
    yellowbutterfly_mc.addEventListener(MouseEvent.MOUSE_UP, stopMove);
    function startMove(evt:MouseEvent):void {
       redbutterfly_mc.startDrag();
       cursor_mc.startDrag();
       violetbutterfly_mc.startDrag();
       yellowbutterfly_mc.startDrag();
    function stopMove(evt:MouseEvent):void {
       redbutterfly_mc.stopDrag();
       cursor_mc.stopDrag();
       violetbutterfly_mc.stopDrag();
       yellowbutterfly_mc.stopDrag();
    But when I'm clicking on a butterfly my cursor stops to move and stays on the position of the butterfly, which i'm dragging. After dropping it, there is no cursor at all so one doesn't know where the mouse is currently located.
    Does someone know why this doesn't work? I'm working currently with a mousefollower, because at the moment this is the only way it works..
    The mousefollower code is:
    addEventListener(Event.ENTER_FRAME, enterFrameHandler)
    function enterFrameHandler(event:Event):void {
        cursor_mc.x += cursor_mc.mouseX / 4;
        cursor_mc.y += cursor_mc.mouseY / 4;
    But now I have the problem that only the yellow butterfly moves even if I'm clicking on the red or the violet...
    Please help me!! Thank you in anticipation!

    You've solved the problem, thank you very much!
    Since it seems you know all about actionscript or at least all answers to my questions, I try my luck a further time
    If I wanted to collect the caught butterflies in a certain target, for example a flowerpot, where the butterflies can't be removed after dragged in, is this more or less the code for it? I haven't tried it yet but I'm searching the internet for something like that and maybe it is the right thing? And is in this case "myTarget" the name of the picture which is used as the target? Thank you in advance!
    function pickUp(event:MouseEvent):void {
        event.target.startDrag(true);
        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){
            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++;

  • Drag and drop simple ".mov" files, into 2 dif. browsers, no longer working

    -
    Did something, that caused my main drag and drop, of simple ".mov" files, into 2 different browsers - "Safari", Version 3.0.4, and "Camino", Version 1.6.8, .. to stop working.
    To be clear, this is regarding, just some simply ".mov" files which I have generated. (Individual hourly, weather images - like; in sequence. Generated, in / with, QuickTime - itself.)
    At this point, where dropped from a folder, into "Camino", .. it routes these back to my main desktop. - (Before the problem, .. played them, in browser.)
    "Safari", only brings up the folder that the main file is in — within a separate folder window.
    (As with "Camino", played these in browser, previously.)
    (Have gone into "preferences", either browser, .. and can't figure things from there.)
    Problem occurred follow two different downloads / installations
    "DjVu Browser Plug-in"
    http://www.caminova.net/en/downloads/download.aspx?id=1
    and, ..
    "Flash Player" (.. for Mac OS 10.4 - 10.5)
    http://get.adobe.com/flashplayer/otherversions/
    Have tried, either "uninstalling", .. or "trashing" these.
    (Uninstalled, "Flash Played" - with specific "Uninstalled" app.. / "Trashed" "DjVu Browser Plug-in".)
    Any help, certainly appreciated.
    Rm(richard583a)

    -
    It, .. or they, don't within either browser that I have installed - and am using, ..
    .. they had previously, ... don't know what I did exactly to caused this circumstance.
    .. is my question. (.. if not fully clear.)
    Just looking to try to find out what I can do, either whether to "back-off" from what I've done - more recently, regarding the two different downloads that I've pointed to above, .. apparently - only, having, superseded a more simply configuration .. previously working.
    This, or either, adjust the settings - broader / somewhere (more generally) - otherwise, .. in order to have these files, play, .. in browser.
    Rm(richard583)

  • Unable to drag and drop mp4 movies into itunes but the file will import and play using home sharing

    Strange problem with my brothers MacBook.
    The movie files were converted to mp4 format ready to be played on an iphone and I imported them into my iTunes on an iMac with no problems.
    Files were also saved onto a flash drive which I passed on to my brother.
    My brother was unable to import files by drag and drop and also by "add to library", we even copied and pasted files from the flash drive to the desktop but that also didn't work.
    Using "home sharing the movies imported and played with no problems.
    Any ideas why this is happening?

    This appears to be a long-standing bug:
    https://bugzilla.mozilla.org/show_bug.cgi?id=634720
    and the accepted workaround is stated in comment 11.
    Oddly, it's possible to do the reverse, i.e. drag multiple eml files from Explorer to a TB folder.

  • Drag and Drop iPod Movies. Why Not?

    You know, I have been wondering something for a very long time and I am amazed that I cannot find any threads anywhere by folks with the same thought process...
    Why are there not commercially-available, pre-encoded, drag and drop files of movies and DVDs for iPod?
    They make the PSP movies. Wouldnt this be a natural, with the sucess of the iPod and iTunes??
    One goes to their neighborhood DVD retailer, buys an iPod-ready CD or DVD, takes it home and drag and drops the files into the iPod. Instead of wasting hours converting the DVD....
    Food for thought during this commercially exploited holiday season....

    This can happen if you don't have write access to the source folder, or if the source and destination are on different drives. Select the folder you're trying to move files from in the Finder and choose Get Info from the File menu; you can check and change the permissions in the Ownership & Permissions section.
    (19396)

  • Drag and Drop a .mov into iMovie and, Why the wait?

    Alright. This is getting very annoying. Every time I use iMovie, dragging my .movs into the application, I've got to wait about 12-15 minutes for it to "import" it. This is ridiculous. Since I've got 7 .movs to import, it's going to take me a couple hours "tonight" just to import them. Will have to do editing "some other day."
    I'm I doing something wrong. What's with the waiting?

    .mov is a container, no video codec. a mov can contain dozends of codecs, stills, music, aiff, mp3, aac, qtvr, video, h263, h264, sorenson1/2/3, mpeg1/2/4, divx ... etc.
    iMHD6 is a DV-editor, meant to copy (=import lossless) from miniDV devices.. which use 'dv' as codec.
    so, if your .mov contain anything else than dv+specific NTSC/PAL settings, the underlying Quicktime engines has to convert it.. a process of high computation = time.
    plus, depending on your set-up, that process can take more or less time.. e.g. not enough disk-space 'brakes' the apps ...

  • Flex Drag And drop

    Hello All,
    I'm having problems suspending a drag and drop operation based on User input from an Alert prompt. i have a flex tree that acts as a drag initiator and a drop target as well (Dragging items of the tree within the tree itself) I'm trying to do a drag and then fire an alert prompt asking the user something like "Are you sure you want to move this item? Yes or No" when the item is dropped to a different location in the tree.
    My first problem was that, the item is moved regardless of the outcome of the user's choice and i had to do an event.preventDefault() on the Drag drop handler to stop this from happening, After which i put my own custum logic saving the drag event  to a variable to later redispatch it to complete the DnD process (Which seems rational).
    My question is, Am I suspending the right type of event? How do i get something as simple as this working. After a while i started receiving this error "Error: Attempt to access a dead clipboard", is this a bug with the flex framework.
    Any form of help will be very much appreciated, i also googled, stackoverflowed, and looked through every flex cookbook i know but no solution.
    Please help me

    Thanks Alex.
    So are you saying this is almost impossible? Is there a way to somehow add the item to the tree's datapovider without showing a visual feedback in the tree. That is making the Tree UI not reflecting the newly added item after the drop, then showing the alert, getting the users input then doing a final clean up in the tree (by calling tree.invalidateList()//tree.validateNow()/or refreshDataProvider ) on dragComplete.
    whats your opinion on this?

  • Drag and Drop Interaction Wizard

    I am having problems with the Drag and Drop Interaction Wizard.  I am using Captivate (6.1) and when I launch the wizard I am able to select the drag objects and drop targets, but when I get to Step 3 (mapping), I am unable to map the drag sources to the drop targets.  When I double click on the drag source and draw the arrow to the drop target, the arrow disappears. 
    Has anyone else had this problem?  If so, what did you do about it?

    Hi,
    You do not want to double click on the object in Step 3. All you need to do to map the source to destination, on the Green Items you would notice a '+' symbol, drag and put them on the drop item, you would able to map them easily that way, double clicking them would deselect the object.
    For more clarification, what this video tutorial --
    http://www.youtube.com/watch?v=ILtUftHxmag
    Thanks,
    Anjaneai

  • Problem with Drag and drop manager

    I am noticing that the sample provided at
    http://livedocs.adobe.com/flex/3/html/help.html?content=dragdrop_7.html is not working when tried on any version of FireFox browser on a Mac OS version 10.6.3.
    So my understanding is that there seems to be some problem with the drag and drop manager in Flex when used on Firefox on a Mac OS version 10.6.3.
    It will be very helpful if you can provide any work around for this issue. We want to implement the drag and drop feature in a website that we are building for one of our clients.

    You must be an Oracle employee as you're referring to a component in the upcoming JDeveloper version which has yet been released to the general public. Oracle employee's are, I believe, directed to post on internal Oracle forums.
    CM.

  • Drag and Drop not supported in TextBox in Automation

    Hi All,     This is regarding the drag and drop functionality support in text box in Flex automation. I am using the automation API of Flex. since our application is having multiple modules, I had to use the automation swc given as an attachment in the JIRA Issue 1088. ( bugs.adobe.com/jira/browser/FlexEnt-1088) But these swc are not recording drag and drop on to text box. I tried adding the drag and drop events to the AutoQuickEnv.xml for textbox ; but in vain. Any help is appreciated.  Regards Gireesh

    Hi Torsten
    Thank you for this hint!
    I've installed NW 7.02 ABAP trial within a win x 64 VM on an ESXi 4.1 VMWare Server.
    NSP is running - but shows also the problem described in this thread.
    So I tried to solve this issue by applying note1576441 - logged on as BCUSER.
    BUT:
    I need ACCESS KEYs to modify the relevant SAP objects.
    My question:
    Where can I get the appr. ACCESS KEYs for the SAP objects I've to correct as described within note 1576441?
    Do I have logged on as DDIC or SAP* or ...*
    Would be great if you or anyone of this community has a hint acc. to this issue!
    Thank you all in advance!
    Regards, Stefan

  • 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?

Maybe you are looking for

  • Premiere Pro has encountered an error.  CS6

    Dear Adobe Community I would be grateful for some help as Premiere Pro has begun crashing on me. I am using CS6 - on two different Mac computers that both encounter the same problem.  I am making a film 1920 x 1080 made up of almost 60 smaller films

  • Passing '**********' to screen field value instead of internal table value

    Hi All, I have written BDC, in which when i pass value for second screen "Description type field"  it's passing '*************************' instead of internal table value. It's picking correct value for first internal table value. Could anyone pleas

  • Asset master uplode

    Hi can any one tell me the Asset Master Uplode throw LSMW  step by step this id deleted Thanks & regards Kumar Delhi

  • CANNOT PRINT FROM ELEMENTS 10

    Not long ago I created a few documents and printed them out from Elements 10, now for some reason I cannot print, and I am getting error messages telling me to install my printer when there is one already installed.  Please help!

  • Cisco pix 501 open port problem

    Hi, I'm running a Pix 501 for Home office and I want to open first ports for my mail client for an outside located server. But i get following error in the log: 106023: Deny tcp src outside:<ipmailserver>/993 dst inside:<ipoutsideinterface>/1729 by a