Adobe Flex 4 Drag and drop example in application

I have been looking at the following example:
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf64595-7fed.html#WS2d b454920e96a9e51e63e3d11c0bf69084-7cee
The example works in web based flash project, but if I use the same code in a desktop AIR project image does not move to the mouse position. (this is obvilously after I have changed the Application container to a WindowedApplication container)
It seems to be due to the fact that the parent container stops receiving mouse move events while dragging. The image then moves to a position relative the where the mouse clicked inside the image.
I was hoping someone would be able to tell me what I am doing wrong?

I've managed to solve the issue using event.localX instead.

Similar Messages

  • Search drag and drop example

    I'm looking for a simple drag and drop example between two JList, what's the good way to do that....

    Try to start www.google.com
    enter "Drag Drop JList" and search i think the second is best:
    http://java.sun.com/docs/books/tutorial/dnd/sheetal.html
    sorry ;-) but you asked for a good way to look for a simple drag and drop example.

  • Really simple drag and drop example?

    I have just began exploring Adobe AIR and have succesfully
    managed to load images into an image component, through drag and
    drop from the desktop.
    Now I am trying to understand how to do the reverse —
    how to drag from the image component to the desktop, but after
    spending several hours googling I still haven't found an example
    that show how to achieve this. Either the samples are outdated,
    from the beta period, or to complicated for me to understand.
    Could someone please help me by showing how it is done, in
    the simplest possible way?
    Thanks in advance.

    Hi,
    You could let Christophe's excellent components do the heavy
    lifting for you:
    http://coenraets.org/blog/2007/06/air-to-desktop-drag-and-drop-two-simple-utility-classes/
    Or here's a good simple app with code that shows you how it's
    done:
    http://www.wabysabi.com/blog/2008/03/18/air-example-native-drag-n-drop-and-clipboard-integ ration/

  • Drag and drop examples do not work ?!

    Hi guys,
    i want to add drag and drop functionality to one of my programs
    i tried to run the java examples of this page:
    http://java.sun.com/docs/books/tutorial/uiswing/dnd/intro.html
    but it just does not work ! windows give me the "can't drop" icon when i drag a file in the frame
    do you experience the same problem?
    Thanks in advance

    i tried:
    A Simple Example: Adding DnD to JLabel
    and
    Data Transfer with a Custom Component
    For both of these, i downloaded/compiled/executed the sourcecode ; there was no error. But the drop couldn't be done
    EDIT: in fact i just realised i didn't read the "try this" instructions and i misunderstood what the progs were supposed to do... in fact they work, they just don't do what i thought they would do XD
    sorry..
    EDIT2 I found a package for easy drag and drop operations ( http://iharder.sourceforge.net/current/java/filedrop/ ) so it's useless to answer to this thread any more, tks ^^

  • Adobe Captivate Help | Drag-and-drop interaction (for subscription and Adobe Software Assurance customers only)

    This question was posted in response to the following article: http://helpx.adobe.com/captivate/using/drag-and-drop-interaction.html

    Yep.  But it will only likely get to you in the next version released for NON subscription or ASA customers.  With 6.1 Adobe was giving a preview of the functionality they would be including in your next release.  Either way, whether you upgraded to the subscription edition or waited for the next paid upgrade, you were always going to be paying something to get this new functionality.  6.1 users just got it earlier than everyone else.  That was Adobe's decision.  It certainly hasn't been a popular one.

  • Flex 2:  Drag and Drop

    Hi,
    I need help or maybe I can get some advice. I have a TileList
    that gets populated by buttons. I am using HTTPService as my
    WebService. I have a component called Buttons.mxml, to use as
    itemRenderer for my TileListEx.mxml. Everything is good as far as
    displaying all my buttons onto my TileList. My problem is when
    doing Drag-and-Drop. Right now when I drag a button and drop it in
    to a different spot/location (inside my TileList), it moves the
    other buttons too at the same time. I cannot drop a single button
    onto an exact position without affecting the other buttons. Is
    there a way to when you do a drag and drop, it will drop the item
    onto exact position as to where you wanted to drop it in. I
    attached my sample code, maybe someone can help me and give me some
    advice onto how to fix my problem or maybe can tell me a better
    solution of doing this.
    Buttons.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    horizontalAlign="center" verticalGap="0" horizontalGap="0" >
    <mx:Button label="{data.name}" width="100" height="50"
    textAlign="center" />
    </mx:VBox>
    TileListEx.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns:local="*" layout="absolute" backgroundAlpha="0"
    creationComplete="itemRequest.send()">
    <mx:HTTPService id="itemRequest"
    url="C:/TestFlex/menuitem.xml" useProxy="false" />
    <mx:VBox x="10" y="41" width="1000" height="550">
    <mx:Panel width="575" height="550" layout="absolute"
    id="menuItm" title="Fruits">
    <mx:TileList direction="vertical"
    dataProvider="{itemRequest.lastResult.menuitem.items.item}"
    height="100%" width="100%"
    itemRenderer="Buttons" rowHeight="60" columnWidth="110"
    dragEnabled="true" dropEnabled="true" dragMoveEnabled="true"
    dragEnter="true"/>
    </mx:Panel>
    </mx:VBox>
    </mx:Application>
    My menuitem.mxml
    <?xml version="1.0" encoding="Utf-8" ?>
    <menuitem>
    <items><item><name>Combo Chz
    Burg</name></item>
    <item><name>Burger</name></item>
    <item><name>Cheese
    Burger</name></item>
    <item><name>Bac Chz
    Burger</name></item>
    <item><name>Lumberjack</name></item>
    <item><name>Boomer
    Burger</name></item>
    <item><name></name></item>
    <item><name></name></item>
    <item><name>Double
    Play</name></item>
    <item><name></name></item>
    <item><name>No Roll</name></item>
    <item><name></name></item>
    <item><name>Well Done</name></item>
    <item><name>Rare</name></item>
    <item><name></name></item>
    <item><name></name></item>
    <item><name>Sausage</name></item>
    <item><name>Pulled
    Pork</name></item>
    <item><name>Grilled
    Cheese</name></item>
    <item><name></name></item>
    <item><name>Chicken
    Little</name></item>
    <item><name>King of
    Klubs</name></item>
    <item><name></name></item>
    <item><name></name></item>
    <item><name>Do It To
    It</name></item>
    <item><name>Sub</name></item>
    <item><name></name></item>
    <item><name>Hot Drink</name></item>
    <item><name>Bottle
    Water</name></item>
    <item><name>Soda</name></item>
    <item><name></name></item>
    <item><name></name></item>
    <item><name>Open Food</name></item>
    <item><name>Eat In</name></item>
    <item><name>Take Out</name></item>
    <item><name>Phone
    Order</name></item>
    <item><name>Extra</name></item>
    <item><name>Orange</name></item>
    <item><name></name></item>
    <item><name></name></item></items>
    </menuitem>
    Thank you very much in advance.
    -alfie

    When working with drag and drop, troubleshoot starting with
    the most obvious: Where exactly is the Canvas you're dropping onto
    and how large is it. Give the Canvas a temporary red background
    (myCanvas.setStyle("backgroundColor", "#FF0000")) to see exactly
    where it is on the stage. If you can't see it after you've changed
    the background color, chances are you can't drop anything onto it
    either.
    Glancing over your code I see a couple things:
    1. In DesignCanvas, you don't define the dropTarget variable,
    which is supposed to be a reference to the DesignCanvas.
    private function doDragEnter(event:DragEvent):void
    var dropTarget:Canvas = this;
    DragManager.acceptDragDrop(dropTarget);
    2. Your override of updateDisplayList() doesn't include
    super.updateDisplayList(unscaledWidth, unscaledHeight);
    I'd comment out your complete updateDisplayList() override
    and troubleshoot the drop target first, then you can start adding
    the other functionality and see if it works as you'd like.
    P.S. Just as a best practice, start your classes with
    uppercase and variables and functions lowercase, so DesignCanvas,
    not designCanvas.
    TS

  • Drag and Drop Examples?

    Are there any examples out there of an Edge Drag and Drop interaction? I need to create some drag and drop learning interactions in Edge and can't find any good examples.

    So I am at a loss again. I am taking what you made and trying to adapt it to what I need. However whenever I bring in an image instead of using a rectangle the drop part never works. So it works completly fine just as the rectangle but the image now does not. I want the person to drag the image over to the drop area and have it run code once dropped.
    Here is the link to what I have modified so far.
    https://www.dropbox.com/s/lpuv6mdmdi37vya/NewSlide.zip
    I think it may have to do with how it is referenced but not sure and could use some help.

  • Adobe Presenter 10 Drag and Drop questions - only grey box when trying to create

    Hi,
    I try to create drag and drop questions in Presenter 10 and after clicking on Add Question -> Drag Drop, the new window opens but where I should be able to define the questions etc, the screen is just grey. Have the same issue on three other systems as well.
    Flash is updated to latest version and so is Presenter 10.
    Weirdly the installed Flash version is 15, but a right-click into the grey box shows me version 11.
    Any ideas?
    Thanks,
    Chris

    Just in case someone else has the same problem, a chat with Adobe brought the solution:
    On the gray screen, Right click and go to Global settings
    Go to advanced tab
    Scroll down and click "Trusted location settings"
    On the "Trusted location settings" window, click "add" on the bottom
    Click "Add Folder" and select "Local disk c"
    Click "Ok" and Confirm on "Trusted location settings" window
    Worked for me (on three different machines) like a charm!

  • Adobe Reader X - drag and drop

    Hallo,
    seit Einsatz von Adobe Reader X ist es nicht mehr möglich via "drag and drop" Text oder andere Daten von einem PDF-Dokument nach z.B. Word, Excel zu ziehen/kopieren. ist das so gewollt? gibt es eine Möglichkeit (z.B. Regkey) dass "drag and drop" wieder möglich?
    Danke für jegliche Info
    Karin

    When the protection mode is enabled this is not possible.

  • Drag And Drop Example and Pointers

    Hello,
    Could you please point me to some code samples and URLs regarding the implementation of Drag and Drop in JavaFX?
    (I want to implement a DnD between two TableViews)
    Thx v much

    I have done this and can give you some pointers. First see my bug report http://javafx-jira.kenai.com/browse/RT-14750 and you'll see they are working on Drag and Drop but here is how I did it.
    First of all I attached event listeners to a custom row object provided with a row factory. The next thing I did was to create a DropTarget interface and a Draggable interface and a DragPane class. The drag mirror (DragPane) class is the node which will be dragged around the screen and is appended to the parent of your TableView's (assuming they share the same parent). The difficult part was detecting if I was over the drop target. I achieved that with the following code which is sitting inside the skin of a single control managing both the source and destination tables.
        public void onSourceRowDragged(MouseEvent event,CustomDraggableRow row)
            double sceneX = event.getSceneX();
            double sceneY = event.getSceneY();
            if (dragMirror == null) {
                dragMirror = new DragPane(row);
                // check for AnchorPane
                if (control.getParent().getClass().isAssignableFrom(AnchorPane.class)) {
                    AnchorPane p = (AnchorPane)control.getParent();
                    p.getChildren().add(dragMirror);
            javafx.scene.control.TablePosition p;
            // Locate drop target
            DropTarget nTarget = null;               
            Point2D tmpp = destTableContainer.sceneToLocal(sceneX,sceneY);
            Node overDestNode = destTableView.pickNode(tmpp.getX(),tmpp.getY());
            while(!(overDestNode == null || TableRowSkin.class.isAssignableFrom(overDestNode.getClass()))) {
                overDestNode = overDestNode.getParent();
                if (overDestNode == destTableView) {
                    overDestNode = null;
            if (overDestNode != null) {
                TableRowSkin overSkin = (TableRowSkin)overDestNode;
                nTarget = (DropTarget)overSkin.getBehavior().getControl();
            if (dropTarget != null && dropTarget != nTarget) {
                dropTarget.onDraggableExited(event);
                dropTarget = null;
            if (nTarget != null && nTarget != dropTarget) {
                dropTarget = nTarget;
                dropTarget.onDraggableEntered(event);
        }This code really only works if the parent is a shared AnchorPane but it was the most difficult part of the project. As you can see the DragPane has a pointer back to the source, and when the mouse button is released if there is a dropTarget I notify the drop target that the object has been dropped. Lastly the mirror needs to be cleaned up. This technique is currently very slow, I suspect it is because the mouse events takes a long time to bubble up from the cells to the row object. I have plans of optimizing this by making the Row block mouse events from reaching the cells, but I haven't had time to optimize it yet. I also haven't followed the development teams official recommendation of creating an invisible cell over all of the other cells to capture the event because that solution, while possible, does not sound logical.

  • Can't drag and drop files onto Applications in Dock since upgrading to 10.6

    Ever since my wife upgraded her iMac (2 GHz, 2 gigs) to 10.6, she can no longer drag and drop files onto certain applications in her dock to open the file. She has to go into the application and go to "open file" or whatever.
    For example, if she has a Word doc on her desktop, she cannot drag it onto the Word icon in her dock.
    Any advice?

    You have many issues with your and your wife's machine(s). Everything you've posted works here. Reinstall Snow Leopard, repair permissions, and see if that fixes things.

  • Drag and drop in windowed application

    i have created application using drag and drop funcatinalities .it's working in webbrowser as internet application .but i converted int o a windowed application and dra and drop isn't working in that form as desktop app.
    pls help me
    thank you.

    Maybe I should mention that this drag and drop feature doesn't work on ALL the programs, which leads me to believe that this is a system preferences problem. I can't drag into any of the Adobe programs, iPhoto, Kodak Easyshare, etc.
    I understand the Get Info solution, but that is pinpointing only one type of file... I would like to fix this feature for all files.
    Thanking in advance, Ck

  • Drag and Drop - Java -- other application

    Hi,
    I'm writing an application, which requires to transfer the content of textfields through Drag and Drop to any other application.
    Basically this works, but in combination with some applications, e.g. Mozilla, it happens, that the DragSourceListener doesn't recognize, that the Drag and Drop - operation is finished.
    Because of this I get an InvalidDnDOperationException, when I try to start a new Drag and Drop - operation.
    Can anyone tell me, how to solve the problem?
    thanks in advance
    Christoph

    And I get the:
    java.lang.NullPointerException
         at oracle.jbo.uicli.jui.JUPanelBinding.bindUIControl(JUPanelBinding.java:808)
         at empapppack.empframe.jbInit(empframe.java:116)
         at empapppack.empframe.<init>(empframe.java:51)
         at emppapppack.Application1.<init>(Application1.java:13)
         at empapppack.Application1.main(Application1.java:50)

  • Drag and Drop example porting to Linux does not work

    Hi Guys,
    Encountered this problem : I have a JFrame that displays the name and path of a file that is dragged from a Windows(Explorer) environment into the frame. This works seamlessly in Windows. However, porting to Linux and doing the same thing(dragging the file from File Manager into the Frame to display the file name and path) does not work.
    I suspect the case may be something to do with the flavormap.properties file found in the jdk1.xx/jre/lib file. Can anyone help?
    RG

    Hi,
    I don't know what is causing the problem, but I have been able to avoid it by starting Jdeveloper from $home\jdev\bin\jdev.exe.
    Regards,
    Mathias

  • Drag and drop from external Application

    I drag some text from outside indesign, on a page so the text is imported.<br />What I want is to get the text in the function ProcessDragDropCommand.<br />But the problem is how can I get the text.<br />I tried this               <br />InterfacePtr<IDataExchangeHandler> dataExchangeHandler(controller->QueryHandler(kTEXTExternalFlavor)); <br />ASSERT(dataExchangeHandler); <br /><br />if (!dataExchangeHandler) break;<br /><br />if( dataExchangeHandler->IsEmpty())<br /><br />but it is always empty.<br />How do I proceed

    That is an issue that you should take up with Adobe. Aside from the piracy issues involved with copying a legal installation to a possible illegal installation, I believe that Adobe uses serial codes unique to each of their apps that you need in order to activate a legal installation of their software. Their apps are very complicated as well and usually need to be installed by their proprietary installer app from their installation DVD to make sure that you have all of the pieces in their correct location.
    Welcome to the 21st Century by the way with Snow Leopard.
    Dah•veed

Maybe you are looking for

  • How can I convert 400 data points from a spreadsheet file to an array?

    The spreadsheet file contains over 5000 data points (in one column) of which I only want the first 400 and want to convert them to an array in Labview. I tried to use the 'readfromspreadsheet' vi but it wasn't much help. Please tell me how i should a

  • Problem in XI Receiver

    Hi Guys, Im using  SAP XI version 7...im just a beginner using XI.. In runtime workbench...the comm channel for sender and receiver is correctly configured and started but in status its has an error. This is the actual path of my comm channel. *file

  • Problem in Purchase Requisition Upload

    Hi all, I am uploading Purchase Requisition through BAPI by BAPI_REQUISITION_CREATE. Then I am appending text both in items and header by fm CREATE TEXT. But when i am uploading the item text Line Comments are transfering with the extra characters. e

  • How do I get my videos to play their sound over my soundtrack?

    I have been working on my project for quite some time, and have figured this out at one point, however, I cannot remember how to solve my problem. I have uploaded videos into my imovie project, however, I cannot hear the sound of these videos over my

  • Can I insert separate still images as background to a video clip?

    Hi! I'm fairly new to video editing. Can someone tell me if it is possible to edit a video using Final Cur Pro X to include whatever images I want as the background to a person singing in a video clip? If so, how? Thanks!