MovieClip only, Drag and Drop to multiple targets

So I've been sitting for the last few hours trying to search the Web for solutions to be able to drag and drop a MovieClip between multiple targets. I have no idea and I am struggling to find something that will help me with this. This is for a class assignment slide / move and I would like to help, please let. This is the general pattern.

The scene is a multiple-choice questionnaire. There are 3 statements aligned next to 3 boxes, these are my targets. A movieclip appears in the corner, that's the question I want to activate him drag / drop in one of the 3 targets. These targets are named separately as target1_mc, target2_mc and target3_mc. The movieclip that is the 'selector' for the multiple choice is named selector_mc.

I only know the basic drag and drop the script that has been taught in class, but it's only for one target, not 3. A picture has been provided below. Again, selector_mc is the blue square in the upper part of the screen. Targets (target1_mc, target2_mc, target3_mc) are on the right side of the screen. I want to leave this blue square to be able to drag and drop on targets and areas nod to one of them, invoking a response to it.

Capture.PNG

selector_mc.origX = selector_mc._x;

selector_mc.origY = selector_mc._y;

{selector_mc.onPress = Function ()}

this.startDrag ();

}

{selector_mc.onRelease = Function ()}

this.stopDrag ();

{if (Eval (this._droptarget) == target1_mc)}

do something. Red Dragon has been selected

This ._x = target1_mc._x;

This ._y = target1_mc._y;

} else

{if (Eval (this._droptarget) == target2_mc)}

do something. White Dragon has been selected

This ._x = target2_mc._x;

This ._y = target2_mc._y;

} else

{if (Eval (this._droptarget) == target3_mc)}

something.blackdragon has been selected

This ._x = target3_mc._x;

This ._y = target3_mc._y;

} else {}

all lack em

This ._x = this.origX;

This ._y = this.origY;

}

}

Tags: Adobe Animate

Similar Questions

  • How to rotate the movieclip with drag and drop?

    Hello everyone,

    I work with drag and drop game.

    I'm done with drag and drop. now, I have problem in totating the movieclip.

    I want video clip rotate using the mouse. Do not use the click mouse. !!!

    Can someone give me a solution for this?

    var isDrageen:Boolean;

    var lastX:Number;

    var derriГЁre: Number;

    var dragX:Number;

    var dragY:Number;

    stage.addEventListener (MouseEvent.MOUSE_DOWN, down);

    stage.addEventListener (MouseEvent.MOUSE_UP, up);

    stage.addEventListener (MouseEvent.MOUSE_MOVE, mov);

    function down(e:MouseEvent):void {}

    isDrageen = true;

    lastX = mouseX;

    derriГЁre = mouseY;

    }

    function up(e:MouseEvent):void {}

    isDrageen = false

    }

    function mov(e:MouseEvent):void {}

    {if (isDrageen)}

    dragX = mouseX-lastX;

    dragY = mouseY-derriГЁre;

    MC.rotationY += dragX/1.65;

    MC.rotationX += dragY/1.65;

    lastX = mouseX;

    derriГЁre = mouseY;

    }

    }

  • Drag and Drop Captivate 9

    Hello!

    I created a drag and drop.  3 target and down 3 points.

    • When an item is dragged, properly, I want to play a sound.  And, it does.
    • When I drag the element according to the target, and that's okay, I hear nothing.
    • The same with the third answer.

      Question 2;
    • What the fall and drag supposed to work with the button 'Submit' I have these sounds applied when the answer is correct?
    • How long must we show on the timeline?

    Thank you

    Norma

    Submit the will confirm the answer, add the score to total score and the actions that you specify on the success, failure will be executed.

    Noise: you configured the actions of the object to play the sound?

    No need to increase the timeline, D & D has a point of suspension. Actions tab see: default setting is 1.5secs. Submit that the read head can be released, that's why the default success action was defined on continue; You can change this action of course.

  • [Request] Drag and drop the problem

    Untitled2.png

    Hello everyone, I am a new Member here, and I just installed Adobe Flash Professional CS6 on my computer. I want a simple quiz with drag and drop a feature inside. I want to drag the squares marked a (Square_1) since the first position with 'STAR' in the white square (Target_1), I already dropped the script, but whenever I leave A square on the white square (Target_1), it does not precisely on the white square (Target_1). I use this script to drag and drop with the target job:

    var startX:Number;
    var startY:Number;
    
    Square_1.addEventListener(MouseEvent.MOUSE_DOWN, pickMe);
    Square_1.addEventListener(MouseEvent.MOUSE_UP, dropMe);
    
    function pickMe(event:MouseEvent):void {
        event.target.startDrag(true);
        startX = event.target.x;
        startY = event.target.y;
    }
    function dropMe(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 == Target_1){
            event.target.removeEventListener(MouseEvent.MOUSE_DOWN, pickMe);
            event.target.removeEventListener(MouseEvent.MOUSE_UP, dropMe);
            event.target.buttonMode = false;
            event.target.x = Target_1.x;
            event.target.y = Target_1.y;
    
        } else {
            event.target.x = startX;
            event.target.y = startY;
        }
    
    }
    
    

    Any help would be appreciated. Thank you.

    If has and that white square was all colon reg, in their centers, or both upper-left you wouldn't have a problem.  as it is with the white square with upper left reg and has with dot central reg, you can use:

    event.target.x = Target_1.x+Target_1.width/2;
            event.target.y = Target_1.y+Target_1.height/2;

    but it would be better to use reg consistent throughout your application.

  • Is it possible to reduce the "suction" items fall dragged and drop?

    I am developing a game where the user must correctly space objects between them depending on what is their relationship to each other.  Falling objects are in fact completely transparent, and the user must place the point slide perfectly on top of it. The problem is that when the user does not place the object from sliding directly on top of the object to be moved, it nevertheless gets pulled to this object. 1. I want that there is virtually no traction power.  2. I would also like the user to be able to stream, click on the object to move and move it slightly until he thinks it's perfectly fine and the stay of the object where it let him down - I don't want it pulled back to its origin.

    If possible, let me know!

    Thank you!

    Ryan

    Hello

    It is possible to redrag and withdraw the power of pull by setting the following two parameters.

    1 Select the Target Drop, Drag and Drop Panel > accordion target Drop, change of position as "absolute".

    2. activate the option "Source Redrag dropped" to drag and drop the Panel > accordion Interaction properties.

    But with these parameters, it allows to drag the object even when it is removed properly.

    Thank you

    VERALINE Sukumaran.

  • Drag-and-drop Web dilemma

    Any who have or know information on how to implement drag and drop IN a container of the canvas.  I just want to allow users to reposition the items within the same canvas, nothing like that a transfer of list-datagrid. Most tutorials involve not only drag-and-drop container, it is generally container-container.

    Points will BE awarded to successful responses semi-fully.

    Sincerely,

    UbuntuPenguin

    Each container that extends Sprite, has a method

    public function startDrag(lockCenter:Boolean = false, bounds:Rectangle = null):void

    As you can see it the second parameter is a rect where the current object can be move. So just startDrag (false, new Rectagle (parentCanvas.y, parentCanvas.width, parentCanvas.x, parentCanvas.height));

  • Drag and drop inside SWFLoader does not

    I have a Flex application that loads a high Flex application via SWFLoader. The secondary application uses drag-and-drop operations to rearrange items, delete them etc.  The secondary application works perfectly when it runs by itself (for example, not "incorporated" via SWFLoader in the main application).

    Once I have load in the main application using a SWFLoader operations drag - move no longer work correctly. All other events seems to work very well. It is only drag and drop that don't always work right.

    Y at - it something that I'm missing that would cause this issue? I think there may be a property that I need to put on the SWFLoader. I hope someone can help.

    You could maybe make a component, implemented as a module and load only for users who need to see it.

  • Legend 1 success for multiple targets in a Drag and Drop Interaction

    I can't see how I can add legends of success to each target in an interaction drag-and - drop, but you can apply only 1 legend success multiple targets?

    1. The limits of smartshapes are overlapping with each other. For example, the smartshape on the 1st line was overlapped with the one on the 2nd line. For this reason, whenever you place the text of the 'Investment' legend on the smartshape on the 2nd line, it automatically moved to the smartshape on the 1st line. As a result, you could never get the right answer, and where you've ever seen the legend of success.

    Solution: Move the smartshapes another (or resize them) and make sure that there is no overlap.

    2, the number of attempts for this interaction has been on infinity. So, you have to play it until you get it right, but could not qualify because of the mention of the reasons above. That's why you have never seen the legend of failure.

    Solution: Disable the infinite in the accordion of Action and specify the required number of attempts. You will get the legend of failure if you don't get it right in these attempts.

    I just tested these solutions and it worked fine. Let me know if you still face problems.

  • How to drag and drop multiple movieclips at the same time

    Hello world

    I'm a new actonscript 3 and adobe flash CC user and I am building an application but I have been stuck for several days. I have looked everywhere and tried everything I could think of, but I can't yet find a solution to my problem that I thought were pretty basic.

    Basically, let's say I have a rectangle and a circle on the stage. Once I did of the movieclips and assigned an instance name to each of them, I want to be able to perform a drag and drop the Rectangle so that both the rectangle and the circle become movable at the same time.

    For now, I have a mouse down events listener associated with the instance of rectangle, a method startDrag assigned to the rectangle instance and another assigned to the circle. But in this configuration, when I click on and drag the rectangle, only the circle is mobile (only the last line in the code is taken into account).

    I don't know if what I'm trying to achieve is feasible, but any help will be greatly appreciated, thank you!

    The startDrag() method can only work for one object at a time, so in your case the Treaty the last of them, designated the task.  This approach is to temporarily to plant the two objects in a container and then drag the container.

    rectangle.addEventListener (MouseEvent.MOUSE_DOWN, fl_ClickToDrag);  When I click on the rectangle

    var dragMC:MovieClip = new MovieClip();
    addChild (dragMC);

    function fl_ClickToDrag(event:MouseEvent):void

    {
    dragMC.addChild (rectangle);        move objects in the container
    dragMC.addChild (circle);
    dragMC.startDrag ();
    }

    stage.addEventListener (MouseEvent.MOUSE_UP, fl_ReleaseToDrop); When I release the mouse button

    function fl_ReleaseToDrop(event:MouseEvent):void

    {
    dragMC.stopDrag ();
    Rectangle.x += dragMC.x;         Adjust the positions of the objects to their new location
    Rectangle.y += dragMC.y;
    Circle.x += dragMC.x;
    Circle.y += dragMC.y
    addChild (rectangle);                 move back to the scene objects
    addChild (circle);
    dragMC.x = dragMC.y = 0;       reset the benchmark for the dragMC
    }

    All this stuff of repositioning in the Drop function is necessary because when you drag the container, the positions of the content are still on their original coordinates inside the container.  So when you drop them they will resume their x / y positions in their new parent, meaning they go back where they were.  Reposition them where they have been trained to take into account the change in the position of the dragMC.

  • Newbie request for assistance with several drag-and-drop & multiple targets

    I know that this question has been asked a million times, but I get always very well the solution.  I know that the solution called for me the use of tables in a part of my code, but I have problems understanding how to implement it.  I use Flash CS 5.5 with AS3.

    I have a flash drag-and-drop file which is divided into 4 distinct zones on the stage.  On each box, there are 7 places, for 7 different "puzzle pieces".  The first two spaces on each quadrant have very a very specific order for the correct puzzle pieces, while the 5 additional places on each quadrant also have specific parts, but the order is not important.  I have included my code below for reference (note that I have not all instances, finished yet).

    Basically, in code that's been created, the following bodies have specific targets with specific command:

    D1_1_mc, D1_2_mc, D1_1_mc, D2_2_mc, D3_1_mc, D3_2_mc, D4_1_mc and D4_2_mc.

    All other instances, such as D1_3_mc, D2_3_mc, D2_4_mc, etc. have specific quadrants on which they need to fall, but what about the last 5 'spaces' in each quadrant, the order does not matter.  I know that I can continue to do what I do, but I would have preferred that the last 5 pieces on each quandrant do not have to be in a specific order.

    You can provide any assistance is greatly appreciated!

    var startX:Number;

    var startY: number;

    var counter: Number = 0;

    D1_1_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D1_1_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D1_2_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D1_2_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D1_3_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D1_3_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D2_1_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D2_1_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D2_2_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D2_2_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D2_3_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D2_3_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D2_4_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D2_4_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D3_1_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D3_1_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D3_2_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D3_2_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D3_3_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D3_3_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D4_1_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D4_1_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D4_2_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D4_2_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D4_3_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D4_3_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    D4_4_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    D4_4_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    function pickUp(event:MouseEvent):void {}

    event.target.startDrag (true);

    reply_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) {}

    reply_txt. Text = "Good Job!"

    event.target.removeEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    event.target.removeEventListener (MouseEvent.MOUSE_UP, dropIt);

    event.target.buttonMode = false;

    Event.Target.x = myTarget.x;

    Event.Target.y = myTarget.y;

    counter ++;

    } else {}

    reply_txt. Text = "Try Again!";

    Event.Target.x = startX;

    Event.Target.y = startY;

    }

    if(Counter == 5) {}

    reply_txt. Text = "congratulations, you did!"

    }

    }

    D1_1_mc.buttonMode = true;

    D1_2_mc.buttonMode = true;

    D1_3_mc.buttonMode = true;

    D2_1_mc.buttonMode = true;

    D2_2_mc.buttonMode = true;

    D2_3_mc.buttonMode = true;

    D2_4_mc.buttonMode = true;

    D3_1_mc.buttonMode = true;

    D3_2_mc.buttonMode = true;

    D3_2_mc.buttonMode = true;

    D4_1_mc.buttonMode = true;

    D4_2_mc.buttonMode = true;

    D4_3_mc.buttonMode = true;

    D4_4_mc.buttonMode = true;

    Since it seems to afew possible gaps in the code you showed, and what I offer myself in response to your questions, I spent a little time get a working model of what I guess you just using the three targets and the fall of four objects.  If you want, I can make the file available for you, but for now, here's the code that works...

    var startX:Number;
    var startY: number;
    var counter: Number = 0;

    target_D2_1_mc.allowed = new Array (D2_1_mc);
    target_D2_2_mc.allowed = new Array (D2_2_mc);
    target_D2_3_mc.allowed = new Array (D2_3_mc, D2_4_mc);

    D2_1_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    D2_1_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);
    D2_2_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    D2_2_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);
    D2_3_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    D2_3_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);
    D2_4_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    D2_4_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    function pickUp(event:MouseEvent):void {}

    reply_txt. Text = "Good Luck."
    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 ();

    If (event.target.dropTarget! = null & MovieClip (event.target.dropTarget.parent).allowed.indexOf (event.target) >-1) {}
    reply_txt. Text = "Good Job!"
    event.target.removeEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    event.target.removeEventListener (MouseEvent.MOUSE_UP, dropIt);
    event.target.buttonMode = false;
    Event.Target.x = MovieClip (event.target.dropTarget.parent) .x;
    Event.Target.y = there MovieClip (event.target.dropTarget.parent);
    counter ++;
    } else {}
    reply_txt. Text = "Try Again!";
    Event.Target.x = startX;
    Event.Target.y = startY;
    }

    if(Counter == 5) {}
    reply_txt. Text = "congratulations, you did!"
    }
    }

    D2_1_mc.buttonMode = true;
    D2_2_mc.buttonMode = true;
    D2_3_mc.buttonMode = true;
    D2_4_mc.buttonMode = true;

  • Problem with drag and drop multiple lines of ListView

    I work on an example application with 2 views of list that is the players and the team and implement drop and drop as players can be deposited to one list to the other. Everything works as expected when there is selection unique model is enabled in the source list view. However, if I have activated several model selection and drag 2 or more lines of source target list view list view, see the following exception after that the decline is over.

    Exception:

    java.lang.IllegalArgumentException: only objects serializable or ByteBuffer can be used as data with the format of data [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 to be able to drag and drop multiple lines? Looks like we don't have for the type of object, so I created the following which does not solve the problem.

    private DataFormat dataFormat = new DataFormat ("subListPlayers");

    (2) I made changes to support serialization on the data object that seems no more to solve the problem. Tried by implementing the interface Serializable, as well as the implementation of the Externalize interface.

    Can someone Guide please if there is an easy way to implement this behavior?

    Code:

    
    

    public class player

    {

    private String name;

    public player (String name)

    {

    myIdName = name;

    }

    public String getName()

    {

    return the name.

    }

    public void setName (String name)

    {

    myIdName = name;

    }

    @Override

    public boolean equals (Object o)

    {

    If (this == o) return true;

    If (o == null | getClass()! = o.getClass ()) return false;

    A player = o (player);

    If (name! = null? name.equals (player.name): player.name! = null) return false;

    Returns true;

    }

    @Override

    public int hashCode()

    {

    return the name of! = null? name.hashCode (): 0;

    }

    }

    SerializableAttribute public class JavaFXDnDApplication extends Application

    {

    private final static ListView < drive > playersListView = new ListView < drive > ();

    private final static ObservableList < drive > /playerslist is FXCollections.observableArrayList ();.

    private final static ListView < drive > teamListView = new ListView < drive > ();

    private final static GridPane rootPane = new GridPane();

    private DataFormat dataFormat = new DataFormat ("subListPlayers");

    Public Shared Sub main (String [] args)

    {

    Launch (args);

    }

    @Override

    public void start (point primaryStage)

    {

    primaryStage.setTitle ("Drag and Drop Application");

    initializeComponents();

    initializeListeners();

    buildGUI();

    populateData();

    primaryStage.setScene (new scene (rootPane, 400, 325));

    primaryStage.show ();

    }

    Private Sub initializeListeners()

    {

    playersListView.setOnDragDetected (new EventHandler < MouseEvent >)

    {

    @Override

    public void handle (event MouseEvent)

    {

    System.out.println ("setOnDragDetected");

    Dragboard dragBoard = (TransferMode.MOVE) playersListView.startDragAndDrop;

    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 < drive > drive = dragEvent.getDragboard () .getContent (dataFormat) (< drive > ObservableList);

    String player = dragEvent.getDragboard () .getString ();

    teamListView.getItems () .addAll (New Player (player));

    playersList.remove (new Player (player));

    dragEvent.setDropCompleted (true);

    }

    });

    }

    Private Sub 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 Sub populateData()

    {

    () playersList.addAll

    New Player("Adam"), New Player("Alex"), Player ("Alfred") New Player("Albert") new,.

    New Player("Brenda"), New Player("Connie"), Player ("Derek") new new Player ("Donny").

    Player ("Lynne") new, New Player ("Myrtle"), Player ("pink") New Player("Rudolph") new,.

    Player("Tony") new, New Player ("Trudy"), Player ("Williams") New Player ("Zach") new

    );

    playersListView.setItems (playersList);

    }

    Private Sub initializeComponents()

    {

    playersListView.setPrefSize (250, 290);

    playersListView.setEditable (true);

    playersListView.getSelectionModel () .setSelectionMode (SelectionMode.MULTIPLE);

    playersListView.setCellFactory (new reminder < < drive > ListView, ListCell < drive > > ())

    {

    @Override

    public call for ListCell < drive > (ListView < drive > playerListView)

    {

    return again ListCell < drive >)

    {

    @Override

    protected void updateItem (player, boolean b)

    {

    super.updateItem (reader, b);

    If (player! = null)

    {

    setText (player.getName ());

    }

    }

    };

    }

    });

    teamListView.setPrefSize (250, 290);

    teamListView.setEditable (true);

    teamListView.getSelectionModel () .setSelectionMode (SelectionMode.MULTIPLE);

    teamListView.setCellFactory (new reminder < < drive > ListView, ListCell < drive > > ())

    {

    @Override

    public call for ListCell < drive > (ListView < drive > playerListView)

    {

    return again ListCell < drive >)

    {

    @Override

    protected void updateItem (player, boolean b)

    {

    super.updateItem (reader, b);

    If (player! = null)

    {

    setText (player.getName ());

    }

    }

    };

    }

    });

    }

    }

    
    

    Yes, it is a pain. I filed https://javafx-jira.kenai.com/browse/RT-29082 earlier. Go ahead and vote in favour if you're inclined...

    I think that the problem in your case, it is the observable list provided by MultipleSelectionModel.getSelectedItems () is not serializable. So even if you make your player Serializable class, the list is not. The first thing I would try, I think, is to make player implements Serializable and pass in an ArrayList instead of the observable list. If you can do

    content.put(dataFormat, new ArrayList(playersListView.getSelectionModel().getSelectedItems()));
    

    and

    List player = (List) dragEvent.getDragboard().getContent(dataFormat);
    teamListView.getItems().addAll(player);
    

    If it does not, a solution is simply to store the "slipped" into a property list:

    final ListProperty draggedPlayers = new SimpleListProperty();
    //...
    // 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);
    }
    
  • Several Drag and Drop, several targets. CS5

    Hello:

    I do a Multiple of Drag and Drop in several objectives educational puzzle for child 6-7 years trying to teach them a little on which plants grow in environments in the country. So I have a map of the Mexico divided into 3 different areas: desert, forest and tropic and 6 different plants (3 different groups: cactus, pine and tropical flowers, 2 of each) scattered across the stage and around the map. The goal is for children to put plants in the box to the right and then click on "check" button, which triggers a validation process. Each video clip of the plant has 2 frames with a stop(); action on all: the graph of the plant extends on both images and the second picture has a red sign error graphic that indicates an error occurred (if this is the case). Then the validation process triggered by the "check" button is supposed to move the playback cursor in each placed wrongly move clip factory for the second image to show what plants are displaced and move the playhead of the main timeline to a picture that contains a "Please try again" text and a button "restart Puzzle." If the answers are good, an animation plays saying it was VERY WELL DONE! .

    I searched the Internet for some tutorials and found a file which is pretty close to what I need. I tried to adapt the code to my puzzle but failed miserably. The file is here if you want to check (scroll to the bottom of the page, it is called Soldier.fla). I'm not sticking the code here because it is VERY long, but I will if necessary. If you want that I download the files somewhere else and link them here, I will. If you need me to send them, I'll be happy.

    Here is the structure and instance names in my file:

    Departure:

    -Intro animation

    Map:

    -3 video clips: target_1, target_2 and target_3.

    -Each movie clip has two executives with a stop(); action on each.

    -Each movie clip has a frame-by-frame with a color change to show when a clip of plant fell on her.

    Plants:

    -6 video clips: drag_1, drag_2, drag_3, drag_4, drag_5 and drag_6.

    -Each movie clip has two executives with a stop(); action on each.

    -Each video clip has an invisible button in its background layer called dragbutton1 to dragbutton6 respectively.

    -In the second frame of each clip, I placed a sign of error to be displayed when the boy dropped the clip in the wrong target.

    Placement:

    -video clips drag_1 and drag_3 must be embedded in the target_1.

    -video clips drag_2 and drag_4 must be embedded in the target_2.

    -video clips drag_5 and drag_6 must be embedded in the target_3.

    Buttons:

    -Puzzle AutoScan: main playhead moves to an image named 'play '. It shows after the Intro animation.

    -Check the button: Validation process. If there is any mistakes sends the playhead to main to a named 'wrong' image (here is the text of "Please try" again). If there is no error, sends the playhead to main to a framework called 'good' where begins the animation "Very well done". It shows when start the puzzle.

    -Restart the Puzzle button: moves the main playback head to frame of 'Play '. It shows when start the puzzle.

    -Start button: just restarts. It shows after "Very well done" animation.

    Phew, it was long!

    Now, I'm not a programmer, I'm a designer. I can do buttons and other small things very simplistic but it's just out of my League. Programmers do things my office like PHP (Wordpress, Joomla), a few JS and things like that, but they don't do any ActionScript. They are trying to help but let drop the ball and I tried to understand this since Friday (I took this as a challenge and he lost). The customer wants in AS2, but if you can help me in AS3, screw the customer!

    If one of you can help me with the code, or point me to the right place, I'll be in debt to you. Forever.

    Thank you very much.

    This is a typo and should be:

    var dragA:Array = [drag_1, drag_2, drag_3, drag_4, drag_5, drag_6];

    for (var i: Number = 0; i<>

    [i] dragA dragA [i] ._x = .startX;

    [i] dragA .startY dragA [i] ._y =

    If (i == 0 |) I == 2) {}

    dragA [i] .target = target_1;

    } else if (i == 1 |) I == 3) {}

    Dropped [i] .target = target_2;

    } else {}

    Dropped [i] .target = target_3;

    }

    {dragA [i] .onPress = function ()}

    this.startDrag ();

    }

    dragA [i] .onRelease = function () {}

    this.stopDrag ();

    checkTarget (this);

    }

    }

    function checkTarget(drag_mc:MovieClip):Void {}

    {if (drag_mc. HitTest (drag_mc. Target))}

    feedback. Text = "done Well! »

    } else {}

    feedback. Text = "Missed";

    drag_mc._x = drag_mc.startX;

    drag_mc._y = drag_mc.startY;

    }

  • Drag and drop - lots of sources to a Drop target

    I have a D & D built scenario where I have 13 objects potential drag, enter a single drop zone. I have the set drop target to accept all the potential that they may all be considered "correct" its a learning experience, not a question of quiz, as well as several items can be deleted. I want to count to 5 and then offer the opportunity to continue to the next section.

    I wonder, to simply count items 5 (in any combination), I would just do a conditional action called "correct" and then set it to zero... and then when an article is accepted, a tip action sets 'proper' fix + 1. and then a conditional action would trigger the 'next' button and the message when correct was equal to 5?

    I did something similar from the selections with buttons, but not with the drag and drop. Does anyone have an overview of how to count the elements correctly deleted? When my account hits 5 fell, I want to bring up the 'Thank you now extend' option.

    Thanks in advance.

    JPM

    Hello

    It is a possible workflow, I used a tip action, but if you want to do this more than once, or to different numbers of counter, I propose to create a joint instead. Will try to explain my work flow (did not use the 13 7 do but drag sources, my account was created to3):

    1. Create a v_counter variable user, with the default value 0
    2. Create interaction D & D according to the normal procedure, BUT do not forget to assign a type to the drag_sources; that will make it easier not only to create the interaction (you need only a single link from 'type' to the target) to affect the action. I've created a «Ellips» type
    3. Create the message appears when the user drags the correct number of objects, and the next button, but both are invisible in the properties panel. I have marked their 'Star' (for the message) and BtNext
    4. Create an advanced (or shared action) which will be conditional with two decisions, the first decision is a Standard measure simulated to increment the counter. Then, check the meter and displays the message and button if the number is correct.
    5. Assign to this fast action to the action object column (see Format tab for the Actions of the object in case button you are on CP8) for the type.

    More tips for D & D: advice & glide - Captivate blog

  • CP 7 - only return incorrect drag and drop answers

    Product: Captivate 7

    Feature: Drag and Drop

    When you click on submit, is there a way for CP 7 to return only incorrect drag and drop of responses to their starting position?

    The following two positions was asked the same thing, but no one has had a chance to respond.

    http://Captivate.Adobe.com/Captivate/topics/drag_and_drop_send_back_incorrect_answers_only

    http://forums.Adobe.com/thread/1280177

    Thank you!

    Micky

    I don't think it's possible to reset after clicking on the "submit" button. (May be it is possible using advanced actions).

    However, you can set the target to reject the wrong answer, the incorrect source of the moment is placed on it. Select the target, choose accordion Drop Target, click on accept, deselect the checkboxes against unacceptable options.

    Anthony

  • Drag and drop them into simple errors of target, expecting identifier?

    IM creating a drag and drop. pass a guitarest name to a dragging for example, target a movieclip called slash to a dynamic text box called box_slash this is my code and I get 2 silly mistakes, but have been up all night and he can not know!

    flash cs5 actionscript 3, this is the code for actionscript3 I found the basis for him here: http://edutechwiki.unige.ch/en/Flash_drag_and_drop_tutorial any help would be amazing for a transfer and im new to Flash

    var = 0 hits;

    Registry of the 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);

    Set a mouse down Manager (the user is dragging)

    function mouseDownHandler(evt:MouseEvent):void {}

    var object = evt.target;

    We have to limit them by 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 form of

    the object on which we have abandoned the circle.

    var target = obj.dropTarget;

    If the target object is the we ask the test_match function

    compare moved obj, and target where he was abandoned.

    If (target! = null)

    {

    test_match (target, obj);

    }

    obj.stopDrag ();

    }

    function test_match (target, obj) {}

    test if one of the four pairs match

    If ((cible == box_slash & & obj == slash) |)

    (target == box_clapton & & obj == clapton) |

    (cible == box_hendrix & & obj == hendrix) |)

    {

    We got a great success

    Hits = hits + 1;

    textField.text = "" OK! :) ";"

    make the object transparent

    obj.Alpha = 0.5;

    kill its event listeners - object cannot be moved more

    obj.removeEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

    obj.removeEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

    Test if we are done

    If (hits is 3)

    {

    textField.text = "well done";

    }

    }

    on the other

    {

    textField.text = ' bad!:(";).

    }

    }

    errors are: I've highlighted lines

    Scene 1, Layer 'Actions', frame 1, line 391084: syntax error: expecting rightparen before leftbrace.
    Scene 1, Layer 'Actions', frame 1, line 381084: syntax error: expecting identifier before rightparen.

    sprites and movieclips can be dragged/dropped, not simple buttons.

    use a movieclip button (so you can use startDrag with it) or use an enterframe loop that causes your easy button to use the mouse (which resembles a startDrag).

Maybe you are looking for

  • Error 1722 CPP not available

    I have Windows 2008 Server with print server, ADS and DNS... everything works fine, but after restarting DNS, DHCP and Eventviewer Services server does not start and the error given RPC service unavailable error: 1722

  • What is the number of spare parts of the neck strap that comes with ILCA - 77M 2 (with printed logo a77II)?

    What is the number of spare parts of the neck strap that comes with ILCA - 77M 2 (with printed logo a77II)? Kind regards Michael

  • W530 WiFi problem

    For some reason any, whenever the W530 connects to my home network. Internet works for a few minutes, sometimes even 30 seconds, before going to the "no network access" I the Centrino Ultimate 6300. Is it a software problem, or a more serious hardwar

  • Get the default location of the press kit

    Hi all There is a static variable, can I access from BlackBerry SDK that contains the path of the default media folder (where are saved images, ringtones, etc.)?

  • Abstract length inconsistencies Cutoff of metadata on the map

    I'm having a weird behavior card as to the duration of power of the metadata on the map.I enclose the screenshots of the behavior, basically, it seems like the length of the metadata field abstract break is not compatible, or even between the cards.