Drag & drop - multi targets that swop?

Is it possible to have two draggables for two targets?
Where drag-A can be dropped on target-A or target-B, but if
it does, then drag-B can only be dropped onto the other target
(where drag-A is not).
The reason for this is a sequence of 15 draggables and
targets for a process that need to be completed in the correct
order. The code is fine for that, but the process has some steps
that can be done in two ways, hence the choice.
In other words, the user can get a correct answer for the
whole process if they decide to make some steps one way or the
other.
I'm intermediate level in flash scripting but don't know the
simplest way to do this. I've research the flash sites but nothing
comes close. Maybe the instance names have to be changed
dynamically via if/else? Maybe on drop of drag-A onto target-B
asomehow changes the logic.

"kglad" <[email protected]> wrote in message
news:fjibuu$jta$[email protected]..
> apply your startDrag() to the loader.
Thanks for your reply. I tried to isolate just the picture as
follows:
function dragPic(event:MouseEvent):void {
trace("drag, " + this.parent)
// event.target.startDrag();
// this.startDrag();
var test:Loader = Loader(event.target);
test:startDrag();
I got the same results. Its not only dragging the picture,
but it is also
dragging the background JPG file as well. I've tried making
the
background image a movieclip, and that did not change the
results.
I'm sure its something simple, but I haven't found the right
combination or
example.
Bob

Similar Messages

  • Alternative Drag-Drop

    I was wanting to use an alternative to the Drag-Drop KO, one
    that does not require the use of the Winapi.u32 file as the current
    one does. So it would be internally packaged using calculations and
    embedded graphics? etc. Are there any examples out there that do
    not use the KO? Thanks

    Drag and Drop Interactions (Drag.a7p)
    In your show me folder in the Autorware installation
    directory.
    Probably : C:\Program Files\Macromedia\Authorware 7.0\ShowMe
    Mark
    83Dons wrote:
    > I was wanting to use an alternative to the Drag-Drop KO,
    one that does not
    > require the use of the Winapi.u32 file as the current
    one does. So it would be
    > internally packaged using calculations and embedded
    graphics? etc. Are there
    > any examples out there that do not use the KO? Thanks
    >

  • Is there any drag & drop website builder where you can load a template ?

    Is there any drag & drop website builder where you can load a template ?
    I have a themeforest template which is great in html which I like to adjust, but I need a drag & drop website builder that automatically changes the codes and scripts as I can't program....
    I tested some like Bluevoda & wysiwyg webbuilders, but there you can only load their files (.bvd ,...) extensions, not a full site or index.html

    Muse is drag & drop but I'm not sure how well it would work with Themeforest templates.  Muse could very well make a mess of it.
    You might want to ask about this in the Muse discussion forum.
    http://forums.adobe.com/community/muse/help_with_using_adobe_muse?view=discussions
    Nancy O.

  • Drag and drop to target simple errors, expecting identifier?

    im creating a drag and drop. moving a guitarest name to a target e.g draging a movieclip called slash to a dynamic text box called box_slash this is my code and i get 2 stupid errors but have been up all night and cant figure it out!
    flash cs5 actionscript 3, is this code for actionscript3 i found the base for it here: http://edutechwiki.unige.ch/en/Flash_drag_and_drop_tutorial any help would be incredible as it for an assignment and im new to flash
    var hits = 0;
    // Register mouse event functions
    slash.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    slash.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
    clapton.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    clapton.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
    hendrix.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    hendix.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.dropTarget will give us the reference to the shape of
              // the object over which we dropped the circle.
              var target = obj.dropTarget;
              // If the target object exists the we ask the test_match function
              // to compare moved obj and target where it was dropped.
              if (target != null)
                        test_match(target, obj);
              obj.stopDrag();
    function test_match(target,obj) {
              // test if either one of the four pairs match
              if ( (target == box_slash && obj == slash) ||
                 (target == box_clapton && obj == clapton) ||
                   (target == box_hendrix && obj == hendrix) || )
                        // we got a hit
                        hits = hits+1;
                        textField.text = "Correct! :)";
                        // make the object transparent
                        obj.alpha = 0.5;
                        // kill its event listeners - object can't be moved anymore
                        obj.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
                        obj.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
                        // Test if we are done
                        if (hits == 3)
                                  textField.text = "Well Done";
              else
                        textField.text = "wrong! :(";
    the errors are: i have highlighted the lines
    Scene 1, Layer 'Actions', Frame 1, Line 39
    1084: Syntax error: expecting rightparen before leftbrace.
    Scene 1, Layer 'Actions', Frame 1, Line 38
    1084: Syntax error: expecting identifier before rightparen.

    Thankyou very much that does get rid of that error now i get
    Scene 1, Layer 'Actions', Frame 1, Line 42
    1120: Access of undefined property textField.
    Scene 1, Layer 'Actions', Frame 1, Line 51
    1120: Access of undefined property textField.
    Scene 1, Layer 'Actions', Frame 1, Line 56
    1120: Access of undefined property textField.
    now im sure this is simple but im as im sure you have figured out im a complete noob to flash
    textField.text = "Correct! :)";
      textField.text = "Well Done";
    textField.text = "wrong! :(";
    is this something to do with an instance name?

  • How to drag and drop multi tabs to a new tab group?

    When I go to the new feature Tab Groups (shift+ctrl+E), I make a search then some tabs are highlighted but I would like to drag and drop to a new group the highlighted tabs all together not just one by one. Is it possible doing a multi-drag&drop with the CTRL+left mouse button?

    I see where you're going. I'm drawn to Thunderbird because it puts open emails in separate tabs, which makes finding a particular open message easier than searching the task bar for an open outlook message. I do see your point that tab happy programmers, probably too young to remember how cool we thought drag and drop was when it first came out, don't think much of it. As with a lot of software, each programmer has a very limited view of how it their program should be used vs how it is actually used in the wild.
    People work in different ways. When I schedule an appointment with a client, this is often preceded by a series of emails related to whatever the client wants to discuss. I drag and drop those messages into the appointment window so that on the date of the appointment, I have a nice neat summary of the issues right there in the appointment window. I could use workarounds (save email and then attach to the appointment), but that's like a trip back to Windows 3.0 and it's, if I'm not mistaken, 30+ years later. I guess I'll continue to use Tbird for email and outlook for calendar, not my preferred solution, I'd like to flip MS the bird and cut all ties to outlook, and was hoping Tbird was the solution. Not yet, and perhaps not ever, based on your thoughts.

  • I deleted the "desktop" in tiger, can't "alias", "copy" or "drag & drop" anything to it now, I get a message that "desktop can not be changed"

    I was trying to make an alias of "SAFARI" icon to have on the desktop & in the dock as well, I managed to make the safari icon appear on the desktop, but when I wanted to switch from firefox to safari it wouldn't open / start safari, so OK, no big deal, I moved it the trash, ( by rt. click,>move to trash>click ) the horror starts here, everything on the desktop disappeared into the trash !!!!! ......
      So I have tried to "drag & drop", "alias", "copy", "duplicate" to get things back out of the trash, but every attempt is met with a message "the desktop con not be changed",   and whatever I try to bring anything out of the trash window, it gets a "minus - sign" added to it when it crosses over the edge of the trash window, and of course it jumps right back into the trash when the mouse button is released.
    I think (barely) I will need the do a "clean install", or a "restore" from the install DVD to restore / get the desktop back.
    And while the only thing on the desktop now is the HDD icon, clicking it open does not show the desktop in the Lf. column of the window where it should be, or any OS X folders when clicking on anything, but the OS is is running for this post and yahoo, etc., and there is a upward facing arrow next to the "network" name in the left column, that doesn't go away, like after installing some software, this is weird !!
    Any solid ideas welcomed, and Thanks for reading my driveling post,  .....  wayne146  .........
    this is happening on my back-up machine, a G4 400mhz PCI, OS X TIGER 10.4.11 & 9.2.2 in classic ( all the 9.2.2 stuff does still show in the hdd when clicked )
    I am having bigger troubles with my QS 800 dp, so I need this one to stay online, Please help !!!

    to safari it wouldn't open / start safari, so OK, no big deal, I moved it the trash, ( by rt. click,>move to trash>click ) the horror starts here, everything on the desktop disappeared into the trash !!!!!
    I am confused by what you did.
    open / start safari
    What did you do?  This looks like a terminal command.
    Or, did you click on the safari icon then right click on the safari icon then click on open? 
    I do not understand how you that moving to the trash would be helpful.
    I suspect disk corruptions.
    I run disk utility verify the file system on your starup disk.  See below.
    verify & repair your startup drive
    To verify & repair you file system on the startup drive, you will need to run disk utility from you installation DVD.
    This article  will tell you how to get to disk utility.  Once in a disk utility, you can go and attempt to recover the disk.
    http://support.apple.com/kb/TS1417
    To repair your startup drive, you will need to run disk utility from your startup DVD.
    Mac OS X 10.4: About the utilities available on the Mac OS X 10.4 Install DVD
    http://support.apple.com/kb/HT2055
    How to run disk utility from your startup DVD.
    Insert your  startup DVD  into your reader.  Power down your machine.  Hold down to the c key.  Power on your machine.  This will bootup your startup DVD.
    This will bring you to a panel asking you for your language.  Pick your language.
    You you come to the Install Mac OS panel.  Do not install.
    Click on Utilities menu item.  This will give you a pulldown list of utilities.
    Click on the disk utility.
    You are now in disk utility.  Pick your disk.  Click on repair it should be on the lower right of the panel.
    Once the repair completes successfully, you should update your permissions.
    Verify a disk
    As an alternative, you can verify that the filesystem on the disk is correct. You will not be able to repair the file system.
    I suggest that you use disk utility to verify that your startup disk is OK.  Macintosh-HD -> Applications -> Utilities -> Disk Utility  Start up disk utility.  On the left pane view, you will see a list of all your disks.   click on your startup disk.  Click on the First Aid  Tab.  Click on verify.   Hopefully your disk will verify.  If not, you have to boot from your installation DVD and run Disk First Aid from there to attempt to repair your file-system.

  • [svn:fx-3.x] 11952: Merging a drag/ drop related trunk change that should have made it into 3.x.

    Revision: 11952
    Revision: 11952
    Author:   [email protected]
    Date:     2009-11-18 12:42:08 -0800 (Wed, 18 Nov 2009)
    Log Message:
    Merging a drag/drop related trunk change that should have made it into 3.x.
    QE notes: None
    Doc notes: None
    Bugs: SDK-15988
    Reviewer: Jason (originally)
    Tests run: Checkin
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-15988
    Modified Paths:
        flex/sdk/branches/3.x/frameworks/projects/airframework/src/mx/managers/NativeDragManagerI mpl.as

    Obrigado, Dude! Instalei o SQL Developer agora mesmo no GNU/Linux Ubuntu 11.10, depois de uma longa procura na internet pela melhor forma de instalar o SQL Developer. Parabés pelo "post".
    Traslate:
    Thanks, Dude! I installed SQL Developer now in GNU / Linux Ubuntu 11.10, after a long search on the internet for the best way to install SQL Developer. Parabés by "post". 

  • Quiz Template Guru Needed: 1) Target Symbols from Drag&Drop questions persist on subsequent questions!??

    I've been finding some anomalies when testing the movie, for
    instance the question regarding the BA degree keeps telling me the
    answer marked correct in the Component Inspector (# 6 American
    Urban) is incorrect; other times it seems one question contains
    part of another question's graphics, though I have scrupulously
    made sure there is no overlap frame by frame.
    I need someone with experience in quiz templates to go
    through this until you find anomalies like those mentioned above,
    and let me know if you have any idea what's causing them.
    You can download the .fla at
    http://mywebniche.com/test/FrontDeskTest.zip
    The test can be seen at
    http://mywebniche.com/test/FrontDeskTest1.html
    [Note: The Name Field's actionscript is also not working.
    When you enter your name on the first frame, it should appear on
    the results page -- doesn't. Any idea what's wrong there?]
    This is a real project and I really need help getting it bug
    free.
    Thanks.

    I have the solution. It is a bug in Flash for which I got
    them to find a workaround.
    If you ask me they don't spend nearly enought time/energy on
    Flash in education, particularly the quizzes, which have so many
    limitations and are lacking so many obviously needed features.
    I'll post their workaround below, but I want you, and all who
    read it to contact their feedback/wishlist for Flash and complain
    about their Quizzes getting short shrift. Features badly needed
    are:
    - Ability to randomize AND require certain questions to
    always appear.
    - options to enter name and have it appear on Results Page
    along with date and number of times the quiz has been re-taken.
    - the ability to have multiple true/false questions
    - better documentation on how to customize the template
    graphics and how to use original graphics
    - fix the drag & drop component permanently -- this is
    arguably the most useful question format of them all !
    - ability to save customized components -- as component
    templates
    - anything else you can think of that I haven't included here
    Here's the fix:
    1) in your movie, locate an instance of the Drag and Drop
    Interaction component and select it.
    2) Select Edit Symbols from the file menu (Edit > Edit
    Symbols) to edit the symbol
    3) The middle layer should be the Actions Layer.  Select
    frame 1 in that Actions layer and open the Actions panel
    4) Scroll to the bottom of the script and find the
    this.onUnload function located there.
    5) Use your mouse and highlight the contents of that
    function, not including the function name, and copy it.  You
    should have copied the following script:
     var clearLast =
    _parent.SessionArray[_parent.session].drag_objects;
     var len = clearLast.length;
     for(var i=0; i<len; i++){
      _parent[clearLast
    ].removeMovieClip();
    6) Return to the very top of the script and paste a copy of
    this script there prior to the comment stating:
    /*--------------VERSION CONTROL
    INFORMATION----------------------
    Note: You may need to make some room for the new script.
    What this should do is ensure that the unload script is
    called immediately upon the loading of a new drag and drop
    interaction component clearing any prior objects used in the one
    before it.  This was not happening appropriately before
    which is what was causing those dragged objects to remain on the
    screen.

  • How to drag drop a calendar item to a time in next week ?

    Hi
    creating a event through a big menu is fine ... but a very elegant and quick way is to select the cells and write the event. similarly, drag-drop a event is super easy way to re-schedule an event to another time. when i have 20-30 events to re-schedule from current to next week, drag-drop is best.
    however, i am unable to do that. when i drag drop, i cant drop it to next week (i am using weekly view to be able to select any time of destination day for drop - the bi-weekly or monthly views don't allow choice of destination time)
    this could be implemented in two ways :
    1. in current weekly view, if the drag crosses the boundary, calendar shifts to the next (or previous) week. and then i drop the event.
    2. there can be a option to see upto 2 weeks in columns just like 1 week view. i understand that the columns will be too tight but the fullscreen option makes it very usable.
    or, you can suggest your own work-around.

    instead of using target, try using currentTarget...
    event.currentTarget.startDrag();
    event.currentTarget.stopDrag();

  • Reseting a drag & drop game

    Hello All:
    I'm having trouble reseting a drag & drop game. It is a movie clip with two pages: start_pg and game_pg. On start_pg is a start button (start_btn) that goes to game_pg. On game_pg is button (end_btn) that goes back to start_pg. Both buttons share the same layer, so I made each invisible when not of its page. The game works fine, but when the end_btn is clicked, all movie clips that have been dropped, stay there.
    How can I go back to start_pg and reset all movie clips to their original starting point?
    // start game page
    stop();
    end_btn.visible=false;
    start_btn.visible=true;
    start_btn.addEventListener(MouseEvent.CLICK, goGame);
    function goGame (Event:MouseEvent): void
    gotoAndStop("game_pg");
    // game page
    var startX:Number;
    var startY:Number;
    var counter:Number = 0;
    pic_1.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    pic_1.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    pic_3.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    pic_3.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    pic_2.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    pic_2.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    pic_4.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
    pic_4.addEventListener(MouseEvent.MOUSE_UP, dropIt);
    function pickUp(event:MouseEvent):void {
    event.target.startDrag(true);
    event.target.scaleX = 1.2;
    event.target.scaleY= 1.2;
    m_txt.text = "";
    event.target.parent.addChild(event.target);
    startX = event.target.x;
    startY = event.target.y;
    function dropIt(event:MouseEvent):void {
    event.target.stopDrag();
    var myTargetName:String = "target" + event.target.name;
    var myTarget:DisplayObject = getChildByName(myTargetName);
    if (event.target.dropTarget != null && event.target.dropTarget.parent == myTarget){
      event.target.width = 230;
      event.target.height= 190;
      m_txt.text = "Good Job!";
      event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickUp);
      event.target.removeEventListener(MouseEvent.MOUSE_UP, dropIt);
      event.target.buttonMode = false;
      event.target.x = myTarget.x;
      event.target.y = myTarget.y;
      counter++;
    } else {
      m_txt.text = "Try Again!";
      event.target.x = startX;
      event.target.y = startY;
      event.target.width = 50;
    event.target.height= 40;
    if(counter == 4){
            m_txt.text = "Congratulations, you matched all rivers correctly!";
    pic_1.buttonMode = true;
    pic_2.buttonMode = true;
    pic_3.buttonMode = true;
    pic_4.buttonMode = true;
    // end game button
    start_btn.visible=false;
    end_btn.visible=true;
    // end game button
    end_btn.addEventListener(MouseEvent.CLICK, goStart);
    function goStart(Event:MouseEvent):void
    gotoAndStop("start_pg");
    Thanks in advance for any assistance.
    German

    Kglad:
    All my movie clips are on stage. Does it make any difference?
    I tried three options: 1) I didn't change the two functions and added the restore XY action to end_btn. It didn't work.
    end_btn.addEventListener(MouseEvent.CLICK, goStart);
    function goStart(Event:MouseEvent):void
    restoreXY(MovieClip(root));
    gotoAndStop("start_pg");
    The second option. In each function I changed
    the last part restoreXY(mc[obj]); to restoreXY(MovieClip(root));  (this didn't work)
    The third option was adding the storeXY to my function pickUp (which is when all movie clips exist in their original position) and keeping the restore action in end_btn. Didn't work.
    function pickUp(event:MouseEvent):void {
    event.target.startDrag(true);
    event.target.scaleX = 1.2;
    event.target.scaleY= 1.2;
    m_txt.text = "";
    event.target.parent.addChild(event.target);
    startX = event.target.x;
    startY = event.target.y;
    storeXY(MovieClip(root));
    In all cases, I got errors in many lines such as
    1120: Access of undefined property obj the scritp is   if(mc[obj] is "MovieClip" && mc[obj].parent==mc){
    Can you please tell where in my code I should put the storeXY and restoreXY(MovieClip(root));?
    Thanks again for helping me.
    German

  • Issue with Drag/Drop of multiple rows from ListView

    I am working on a sample application with 2 list views i.e. players and team, and implement drop and drop such that players can be dropped from one list view to the other. Everything is working as expected when there is single selection model is enabled on the source list view. However, if I enabled Multiple selection model and drag 2 or more rows from source list view to target list view, seeing the following exception after the drop is completed.
    Exception:
    java.lang.IllegalArgumentException: Only serializable objects or ByteBuffer can be used as data with data format [subListPlayers]
      at com.sun.javafx.tk.quantum.QuantumClipboard.putContent(QuantumClipboard.java:513)
      at javafx.scene.input.Clipboard.setContent(Clipboard.java:230)
    1) What should be the DataFormat used in order to be able to drag and drop multiple rows? Looks like we do not have for Object type, so I have created the following one which does not solve the problem.
       private DataFormat dataFormat = new DataFormat("subListPlayers");
    2) I have made changes to support serialization on the data object which also does not seem to solve the issue. Tried by implementing Serializable interface as well as by implementing Externalize interface.
    Can someone please guide if there is an easy way to implement this behavior?
    Code:
    public class Player
       private String name;
       public Player(String name)
          this.name = name;
       public String getName()
          return name;
       public void setName(String name)
          this.name = name;
       @Override
       public boolean equals(Object o)
          if (this == o) return true;
          if (o == null || getClass() != o.getClass()) return false;
          Player player = (Player) o;
          if (name != null ? !name.equals(player.name) : player.name != null) return false;
          return true;
       @Override
       public int hashCode()
          return name != null ? name.hashCode() : 0;
    public class JavaFXDnDApplication extends Application
       private static final ListView<Player> playersListView = new ListView<Player>();
       private static final ObservableList<Player> playersList = FXCollections.observableArrayList();
       private static final ListView<Player> teamListView = new ListView<Player>();
       private static final GridPane rootPane = new GridPane();
       private DataFormat dataFormat = new DataFormat("subListPlayers");
       public static void main(String[] args)
          launch(args);
       @Override
       public void start(Stage primaryStage)
          primaryStage.setTitle("Drag and Drop Application");
          initializeComponents();
          initializeListeners();
          buildGUI();
          populateData();
          primaryStage.setScene(new Scene(rootPane, 400, 325));
          primaryStage.show();
       private void initializeListeners()
          playersListView.setOnDragDetected(new EventHandler<MouseEvent>()
             @Override
             public void handle(MouseEvent event)
                System.out.println("setOnDragDetected");
                Dragboard dragBoard = playersListView.startDragAndDrop(TransferMode.MOVE);
                ClipboardContent content = new ClipboardContent();
    //            content.putString(playersListView.getSelectionModel().getSelectedItem().getName());
                content.put(dataFormat, playersListView.getSelectionModel().getSelectedItems());
                dragBoard.setContent(content);
          teamListView.setOnDragOver(new EventHandler<DragEvent>()
             @Override
             public void handle(DragEvent dragEvent)
                dragEvent.acceptTransferModes(TransferMode.MOVE);
          teamListView.setOnDragDropped(new EventHandler<DragEvent>()
             @Override
             public void handle(DragEvent dragEvent)
    //            String player = dragEvent.getDragboard().getString();
    //            ObservableList<Player> player = (ObservableList<Player>) dragEvent.getDragboard().getContent(dataFormat);
                String player = dragEvent.getDragboard().getString();
                teamListView.getItems().addAll(new Player(player));
                playersList.remove(new Player(player));
                dragEvent.setDropCompleted(true);
       private void buildGUI()
    //      rootPane.setGridLinesVisible(true);
          rootPane.setPadding(new Insets(10));
          rootPane.setPrefHeight(30);
          rootPane.setPrefWidth(100);
          rootPane.setVgap(20);
          rootPane.setHgap(20);
          rootPane.add(playersListView, 0, 0);
          rootPane.add(teamListView, 1, 0);
       private void populateData()
          playersList.addAll(
                new Player("Adam"), new Player("Alex"), new Player("Alfred"), new Player("Albert"),
                new Player("Brenda"), new Player("Connie"), new Player("Derek"), new Player("Donny"),
                new Player("Lynne"), new Player("Myrtle"), new Player("Rose"), new Player("Rudolph"),
                new Player("Tony"), new Player("Trudy"), new Player("Williams"), new Player("Zach")
          playersListView.setItems(playersList);
       private void initializeComponents()
          playersListView.setPrefSize(250, 290);
          playersListView.setEditable(true);
          playersListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
          playersListView.setCellFactory(new Callback<ListView<Player>, ListCell<Player>>()
             @Override
             public ListCell<Player> call(ListView<Player> playerListView)
                return new ListCell<Player>()
                   @Override
                   protected void updateItem(Player player, boolean b)
                      super.updateItem(player, b);
                      if (player != null)
                         setText(player.getName());
          teamListView.setPrefSize(250, 290);
          teamListView.setEditable(true);
          teamListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
          teamListView.setCellFactory(new Callback<ListView<Player>, ListCell<Player>>()
             @Override
             public ListCell<Player> call(ListView<Player> playerListView)
                return new ListCell<Player>()
                   @Override
                   protected void updateItem(Player player, boolean b)
                      super.updateItem(player, b);
                      if (player != null)
                         setText(player.getName());

    Yeah, this is a pain. I filed https://javafx-jira.kenai.com/browse/RT-29082 a while back. Go ahead and vote for it if you are inclined...
    I think the issue in your case is that the observable list provided by MultipleSelectionModel.getSelectedItems() is not Serializable. So even if you make your Player class Serializable, the list itself isn't. The first thing I would try, I think, is to make Player implement Serializable and then pass in an ArrayList instead of the observable list. So you can do
    content.put(dataFormat, new ArrayList<Player>(playersListView.getSelectionModel().getSelectedItems()));
    and
    List<Player> player = (List<Player>) dragEvent.getDragboard().getContent(dataFormat);
    teamListView.getItems().addAll(player);
    If that doesn't work, a workaround is just to store the "dragged list" in a property:
    final ListProperty<Player> draggedPlayers = new SimpleListProperty<Player>();
    // Drag detected handler:
    content.putString("players");
    draggedPlayers.set(playersListView.getSelectionMode().getSelectedItems());
    // Drag dropped handler:
    if (dragboard.hasString() && dragboard.getString().equals("players")) {
         teamListView.getItems().addAll(draggedPlayers.get());
         draggedPlayers.set(null);

  • Drag & drop

    I am doing a project for quiz. in that quiz, there are 3
    stages. The final one is drag & drop . The target and drop are
    dynamic text boxes . But it doesn't match with its target
    perfectly

    And so your question is?

  • Captivate 8 Drag drop - Many to Many as correct answers? via type.

    Captivate 8 Drag drop - Many to Many as correct answers? i.e. via type grouping of drag image objects
    I've hit a brick wall. I've been testing this drag drop quiz feature via the Interaction Wizard and I've found that drag items assigned to the same type grouping, will only associate with one single target drop object. Is this a limitation of the drag drop wizard or a limitation of Captivate 8?
    I did successfully create a simple many to many drag drop when every drag item was unique, however when duplicating drag items and assigning them to the same type, it seems all the same type want to only have one single valid drop target.
    For example, creating an electronic circuit board quiz, I might have 3 resistors of the same value ( i.e. drag images of resistors ), that I want to be accepted by multiple drop targets ( i.e. rectangles that make up the circuit board ) that will accept a resistor drop item of that same value, as a valid drop item. In essence any of those 3 resistors of the same value, can be dropped in any of the circuit grid 3 cells and all still be correct. I can't seem to make this work, when those 3 resistor images are grouped into one type in the Drag drop Wizard. It only allows them to point to one drop container.
    Thanks,
    David

    Devraj,
    Actually I think I used your first method.   I had about 10 drag sources, some of the same type and some not and 25 drop targets of the same type to deal with.
    The approach I used was to group some of the Drag Source Objects ( like common parts such as multiple wire connector images, 4 in total ) but not group the Drop Target objects ( 25 rectangular shapes that make up the circuit board grid ). That did work successfully. I'm slowly getting to understand the way this drag and drop object type grouping works.
    My next test is to Group the Drop Targets by Drop type that can accept the corresponding Drag type. Thus for my 5 x 5 grid of rectangles objects, the drop rectangle objects that are designated for a given wire connector, would be assigned a drop type of that wire connector. If this can work, it could save even more time, when setting the correct answers. i.e. I would just set the correct answer as a drag type and drop type relationship. I think this could make it easier if I had a really big grid of drop rectangles, as I won't have to specify every single drag drop object relationship.
    Unfortunately so far this method is not working. I keep getting the Incorrect Answer message when testing, even though I know it's the correct drag drop answer. I know the drag source group type works, but the drop target group type is not working in the correct answer association with the drag group type.

  • Drag drop images while composing the forum post

    Hi All,
    Many time I felt like it would be good if we can drag drop images to the forum post being composed.  Similar to Gmail compose, if NI forum composition page also has that drag drop feature, it would be great.  But I'm wondering if it's only me or other people are also out there looking for this feature.
    Thanks,
    Ajay.

    Francois,
    I have tried to implement this bean but I'm having problems. I've been using your
    LAF package for almost 4 years now without issue. I tried the jar file from the zip
    file. I also created a new project and recompiled the java code against the 10.1.2.3
    frmall.jar file that matches our app server. I resigned it and it's still not working.
    Maybe I'm just missing something simple. When I compile and run the form, I see
    the canvas and I can change the text fields, but I don't see how I can drag and
    drop items. Hopefully, you can think of something that can fix our problem. I would
    love to be able to use drag and drop functionality in an upcoming application.
    We're running the following versions:
    App Server: 10.1.2.3
    DB: 10.2.0.5
    JDev: 10.1.3.3.0
    Windows XP for the clients
    Windows Server 2008 for the servers
    Thanks,
    Jason
    Edit: I looked in my java console and saw that my issue was that we signed this jar file with a different certificate. I created a special config as Francois has suggested in another post and included only the DnD.jar file and it worked. However, I can't get the image or multi-line text areas to drag and drop. I'll keep poking around and see if I can figure out what's going on. The console seems to recognize when I'm dragging and dropping from all fields.
    Edited by: hanszarkov on Jun 27, 2011 12:58 PM

  • Drag/Drop E-Learning Interaction

    I developed an e-learning module using the Drag/Drop
    Interaction. But I have several drag objects with only one target
    object- thanks to the instructional designer I'm working w/, and
    I'm not sure if Flash can function correctly w/ only one target
    object. After you answer each question the drag object that was
    dragged to the target disappears. Has anyone tried something
    similar and have knowledge of this potential limitation in
    Flash?

    I'm wondering if this solution I grabbed out of help will
    work..
    _droptarget (MovieClip._droptarget property)
    public _droptarget : String [read-only]
    Returns the absolute path in slash-syntax notation of the
    movie clip instance on which this movie clip was dropped. The
    _droptarget property always returns a path that starts with a slash
    (/). To compare the _droptarget property of an instance to a
    reference, use the eval() function to convert the returned value
    from slash syntax to a dot-syntax reference.
    Note: You must perform this conversion if you are using
    ActionScript 2.0, which does not support slash syntax.
    Availability: ActionScript 1.0; Flash Player 4
    Example
    The following example evaluates the _droptarget property of
    the garbage_mc movie clip instance and uses eval() to convert it
    from slash syntax to a dot syntax reference. The garbage_mc
    reference is then compared to the reference to the trashcan_mc
    movie clip instance. If the two references are equivalent, the
    visibility of garbage_mc is set to false. If they are not
    equivalent, the garbage instance resets to its original position.
    origX = garbage_mc._x;
    origY = garbage_mc._y;
    garbage_mc.onPress = function() {
    this.startDrag();
    garbage_mc.onRelease = function() {
    this.stopDrag();
    if (eval(this._droptarget) == trashcan_mc) {
    this._visible = false;
    } else {
    this._x = origX;
    this._y = origY;

Maybe you are looking for