problem with drag and drop

Hi I have a problem with drag and drop I have 2 clip and I have 2 target, I want when I drag the clip 1 to 1, target 1 to target not accepts the clip2, clip 2 can therefore be enjoy to target 2. (target 1 can accept clip 1 and clip 2, target 2 can also clip accepts 1 & 2)

Stone

clip_piere.addEventListener (MouseEvent.MOUSE_DOWN, dep_piere);

clip_piere.addEventListener (MouseEvent.MOUSE_UP, arreter_piere);

clip_piere.buttonMode = true;

var x_piere, y_piere:Number;

x_piere = clip_piere.x;

y_piere = clip_piere.y;

function dep_piere(event:MouseEvent):void

{

clip_piere.StartDrag ();

}

function arreter_piere(event:MouseEvent):void

{

If (place1.hitTestObject (clip_piere): place2.hitTestObject (clip_piere)) {}

clip_piere.stopDrag ();

clip_piere. RemoveEventListener (MouseEvent.MOUSE_DOWN, dep_piere);

} else {}

clip_piere.x = x_piere;

clip_piere.y = y_piere;

clip_piere.stopDrag ();

}

}

EAN

clip_ean.addEventListener (MouseEvent.MOUSE_DOWN, dep_ean);

clip_ean.addEventListener (MouseEvent.MOUSE_UP, arreter_ean);

var x_ean, y_ean:Number;

x_ean = clip_ean.x;

y_ean = clip_ean.y;

function dep_ean(event:MouseEvent):void

{

clip_ean.StartDrag ();

}

function arreter_ean(event:MouseEvent):void

{

If (place1.hitTestObject (clip_ean): place2.hitTestObject (clip_ean)) {}

clip_ean.stopDrag ();

clip_ean. RemoveEventListener (MouseEvent.MOUSE_DOWN, dep_ean);

} else {}

clip_ean.x = x_ean;

clip_ean.y = y_ean;

clip_ean.stopDrag ();

}

}

Here is a link to a file that I did for you based on your objects and what I described in my last answer.  I reduced the code so that the
the objects share the same functions.  I moved the MOUSE_UP listener on stage so that it is less prone to failure should drag you the object when slide it / drop.

http://www.nedwebs.com/Flash/AS3_Drag_Targets.fla

Tags: Adobe Animate

Similar Questions

  • 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);
    }
    
  • Problem with Drag and Drop (Captivate 8)

    I have a drag and drop set-up of four headers that must be moved to the appropriate columns.  Objects and targets have all been defined properly.  I also have a "Submit" and "Reset" this button.  I've set up two shares advanced to be executed on the success and failure, respectively.  The approach of successful shows 4 points (a smart shape, 2 text boxes and a button 'Continue'), failure is supposed to show 4 points higher (a smart shape, 2 text boxes and a button "try" again).

    The "Success" action advanced works perfectly.  The action of the Advanced 'failure' is not.  Nothing appears when you provide inaccurate answers, he keeps just a static screen.  The reset button will attempt to reset however.  Must I specify somewhere that all the wrong answers must display text of failure.  I want the text to display if any of the four headers are placed correctly and I thought he would do this by default.

    What Miss me?

    That's what I thought, endless attempts.

    I know it's confusing, but the action of 'Failure' is actually an action "after the last attempt" that you can find for Question slides. This means that infinite attempts, it will never be executed and should be grayed out, but sorry it won't be dimmed. Unlike the legend of default that will appear after each failure. Little inconsistency...

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

    }

    }

  • Hi help me with drag and drop with as3 if you please

    Hello friends,

    I am a newbie to as3 in flash and had a prob with drag and drop features

    var dragArray:Array = [square_word, circle_word, triangle_word];

    var matchArray:Array = [squareMatch, circleMatch, triangleMatch];

    var posArray:Array = [{x: 276, y: 207}, {x: 443, y: 207}, {x: 107, y: 207}];

    var currentClip:MovieClip;

    var startX:Number;

    var startY: number;

    for (var i: int = 0; i < dragArray.length; i ++) {}

    dragArray [i] .buttonMode = true;

    dragArray [i] .addEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);

    matchArray [i] .alpha = 0.2;

    }

    function item_onMouseDown(event:MouseEvent):void {}

    currentClip = MovieClip (event.currentTarget);

    startX = currentClip.x;

    startY = currentClip.y;

    addChild (currentClip); bring to front

    currentClip.startDrag ();

    stage.addEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);

    }

    function stage_onMouseUp(event:MouseEvent):void {}

    stage.removeEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);

    currentClip.stopDrag ();

    var int index = dragArray.indexOf (currentClip);

    var matchClip:MovieClip = MovieClip (matchArray [index]);

    If (matchClip.hitTestPoint (currentClip.x, currentClip.y, true)) {}

    a match was found. Position the clip using the values of posArray:

    currentClip.x = posArray [index] .x;

    currentClip.y = there posArray [index];

    make not draggable:

    currentClip.removeEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);

    currentClip.buttonMode = false;

    } else {}

    football match has not, so send the clip to the back where he began:

    currentClip.x = startX;

    currentClip.y = startY;

    }

    in this code, that I'm not the subject abruptly to its original position if he fell into a movieclip wrong (as we should have the availability of droping the drag square circle alse object) and then we should have a button to check if everything is correctly matched, if not after clicking another button 'correctitself', we should get the good objects droping on correct locations automatically

    Please help with any suggestions ASAP

    }

    assign your listener matchall checkAllMatchF and use button:

    var dragArray:Array = [square_word, circle_word, triangle_word];

    var matchArray:Array = [squareMatch, circleMatch, triangleMatch];

    var posArray:Array = [{x: 276, y: 207}, {x: 443, y: 207}, {x: 107, y: 207}];

    var currentClip:MovieClip;

    var startX:Number;

    var startY: number;

    for (var i: int = 0; i< dragarray.length;="" i++)="">

    dragArray [i] .buttonMode = true;

    dragArray [i] .addEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);

    matchArray [i] .alpha = 0.2;

    }

    function item_onMouseDown(event:MouseEvent):void {}

    currentClip = MovieClip (event.currentTarget);

    startX = currentClip.x;

    startY = currentClip.y;

    addChild (currentClip); bring to front

    currentClip.startDrag ();

    stage.addEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);

    }

    function stage_onMouseUp(event:MouseEvent):void {}

    stage.removeEventListener (MouseEvent.MOUSE_UP, stage_onMouseUp);

    currentClip.stopDrag ();

    var int index = dragArray.indexOf (currentClip);

    var matchClip:MovieClip = MovieClip (matchArray [index]);

    If (matchClip.hitTestPoint (currentClip.x, currentClip.y, true)) {}

    a match was found. Position the clip using the values of posArray:

    currentClip.x = posArray [index] .x;

    currentClip.y = there posArray [index];

    make not draggable:

    currentClip.removeEventListener (MouseEvent.MOUSE_DOWN, item_onMouseDown);

    currentClip.buttonMode = false;

    } else {}

    football match has not, so send the clip to the back where he began:

    currentClip.x = startX;

    currentClip.y = startY;

    }

    }

    function checkAllMatchF (): Boolean {}

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

    If (dragArray [i] .x! = matchArray [i] .x | dragArray [i] there! = matchArray [i] there) {}

    Returns false;

    }

    }

    Returns true;

    }

  • Display collection ArrayCollection in a list and the ArrayCollection with Drag and Drop collection reorgnize

    I have an ArrayCollection collection created like this

    qaAC = new ArrayCollection();

    for (var i: int = 0; i < 10; ++ i) {}
    var o: Object = {question: ' what is "+ i +"? ", answer:" it's "+ i"};
    qaAC.addItem (o);
    }

    The ArrayCollection collection is an array of object that has properties "question" and "answer to" custimized.

    I want to put 'issues' in the ArrayCollection collection in a list. 'qaAC.question' does not return an array of questions for me.

    I have to extract the ArrayCollection collection to form a new String table, and use the new array as the dataProvider of the list of questions.

    Is there a way better and clean?

    My goal is to use a list to reorgnize an ArrayCollection collection that contains complex objects (not simple string) with Drag & Drop. Is this possible?

    Any suggestions?

    I put two lists in my example to show how the ArrayCollection collection could be displayed in two different ways. You don't have to have two lists if you do not need them.

    When you change the order of the list made with drag and drop, you change the order of the collection ArrayCollection qaAC, so all the controls that display the qaAC will also be updated to reflect the new order. You can test this in the example I posted earlier. Change the order in the list of question and you will see the order change also in the list of responses. This is because they are both bound to the same collection of ArrayCollection. If you want to behave independently, you need two separate ArrayCollections.

    Chris

  • ALT + tab no longer works with drag-and-drop

    I bought a new computer Samsung with Windows 8, two weeks ago. On my old computer, I could choose a file in a folder, then alt - tab to another folder and then drop the selected file. Now, every time I select a file and use alt - tab, the file automatically becomes deselected.

    This never happened to me in my previous versions of Windows.

    To be clear: my keyboard and touch pad working perfectly fine. It is a problem of Windows when you use drag-and - drop jointly with alt - tab.

    Hello Boston,

    This feature is also available in Windows 8. You must select a copy of the file and click alt + tab and select the folder where the file should be moved or pasted.

    If this does not work on your computer, you can try to follow the link below and create a new user account and see if that helps. To create a user account follow this link:

    Create the user account

    I hope this helps. Otherwise, feel free to write us again and we will be happy to help you.

    Thank you

  • Need help with drag and drop

    IM really new to this program as a

    day new hehe and I need help. im making a game quiz and your supposed

    ED to score in the hoop with a circle.  I have the

    codes for the drag and drop for the circle, but I need help with the collision between the Hoop and the ball, I want to go to the image next or gotoandPlay when the ball touches the ring. HELP PLEASE

    You should not attach code to objects.  and you can be able to happen by using a loop.

    Start by removing all the code the suggested by maqro (i.e. as3) and by removing all the code attached to objects.

    use:

    {yourobject.onPress = function ()}

    this.startDrag ();

    }

    {yourobject.onRelease = yourobject.onReleaseOutside = function ()}

    this.stopDrag ();

    {if (this.) HitTest (whatever))}

    do something

    }

    }

  • FlashBuilder - how to move the code with drag and drop

    Guys, I must be stupid. Each IDE I worked in allows me to highlight one or more lines of code, and then, when I mouse over the highlighted lines, updates of the cursor to indicate that I can now drag the code, and it moves when I click and drag.

    FlashBuilder (burrito) does not seem to exhibit this feature, but if I hold down the CTRL I do not copy the code via drag and drop.

    There has been one or two occasions where the drag-and - déposer worked, but I can't understand, or reproduce these conditions.

    Can anyone help?

    Thank you

    T

    It should work in Flash Builder, but you are right, that feedback cursor is not very good because it is not updated to show that any sort of slider. Try selecting the text, then click and hold for about a second before you drag it to a new location. If it still does not work for you it must be another problem. Make sure that in preferences, general-> editors-> text editors "Enable drag and drop of text" is turned on.

  • A small problem with Drag &amp; amp; Drop

    Hello!!

    I need to drag an external image on an IMAGE control.
    This is the command:

    "< mx:Image id ="myImg"source =" {File.desktopDirectory.nativePath + "test.png"} "x ="392"y ="267"height ="140"width ="150" dragDrop =" DropHandler (event) " dragEnter ="DragManager.acceptDragDrop (event.currentTarget as Image); » / >

    the 1st problem is that the dragDrop event is not called...
    dragEnter is...

    dragExit works... dragOver too...
    but the dragDrop and dragComplete event not...
    so... I can't try to find a solution for my main problem: get the path to an external image slipped...

    Any help?
    all the tutorial I've read talk about dragging an object in a flex container to another container flex...

    Bye bye... and thank you!

    Quote:
    Posted by: 123qweads
    Image has no option of dropEnabled ^ _ ^.

    Well, it sounds a Bell then? :))

    If the control does not feature move it is useless just to wait that little bit of magic will happen and he will somehow begin to accept drag and drop.

    So what you have to do - create handlers for the mouseOver, mouseMove and mouseUp/down and rip the drop from the mouseUp event.
    See you soon!

  • The show with drag and drop in Captivate 9

    Hello

    I am creating a drag and drop interactivity 9 Captivate. In step 3, when I had to drag the objects from the source to the drop target, all objects in the screen were locked. I couldn't click as well as she was listed on the timeline . Please suggest.

    Using the wizard or the D & D Panel? Is this normal or a receptive

    of the project? You are on Mac or Win.

    For the wizard: .you should see a center point on each source of drag.

    You must drag a line from this central point to the drop target. You did

    create a type?

  • Help with Drag and Drop text

    I am trying to create a series of text objects that I can drag and drop on the screen. I'm trying to text fields in a movieClip container from the Drag and Drop will not work on text fields. When I do that, Flash still sees the objects as fields of text rather than the video clips, and I get the following error.

    ReferenceError: Error #1069: property not found startDrag on flash.text.TextField and there is no default value.
    at chris_fla::MainTimeline/startDragging()

    I'm a newbie to this. What I am doing wrong? Thank you!

    Russ

    Use currentTarget instead of the target.

  • Closed: ADF tree with Drag and Drop

    Hi all

    How to implement drag and drop functionality in ADF tree where we manage to reorganize the tree.
    Is this possible? any material / sample for the same thing.

    Thank you.

    Chris Muir has bloged about this 't-fit-all.blogspot.com/2009/09/jdev-11gr1-aftree-mashup-using.html http://one-size-doesn
    and AMIS has this http://technology.amis.nl/blog/3302/dropping-trees

    Timo

  • I can't delete a duplicate named folders created in error by Thunderbird while moving messages with drag and drop

    I had created a folder with a long as name "Deborah Brown - HP laptop acting, very slow, etc." this file was created to contain messages that have been received in a top-level folder, and then moved to this to the appropriate ranking related emails many. I had done many times before without a problem. But this time, when I slipped and fell on a message in the folder a double was created, but accompanied by an annex of '2547417' at the end of the name. IIRC, the message was in the records at the time of the original and a copy. IIRC, I did not notice this at first and when I dragged/left down another message he created another folder in double, but this time with the suffix "211613d". At any given time more far in the process (I don't remember quite well how) both of these files got duplicated again but this time were with the same name with added suffixes as noted... something I wouldn't have imagined. Given that the messages I was moving were safely (?) stored in the original folder, I deleted the message content duplicated records duplicated without any problem and without any effect on the content of the original file.

    Then I tried to delete the duplicate folders... not allowed. Then I noticed that if I tried to remove the second instance of each duplicate name, which was a success... at least as much as to move it to the trash. If I then returned and tried to delete the first instance it is, once again, not the law. I then tried to rename the files by adding a prefix a single character. Once more, if I worked on the second instance of the name I could rename it but would be foiled again if the first instance. Then, * I think * (extra large grains of salt here) is that I renamed the second instance and removed from the trash that I could then work on the others and rename and empty the trash.

    But everything for nothing. If I closed Thunderbird and restarted the duplicate folder names reappearing. Then I tried the fix given for not being able to delete messages because of a corrupt trash folder. That did not help either. Even if I use a POP account and could remove the files from the two basket my account information, whenever I would restart Thunderbird trash will reappear by himself and the so-called deleted duplicate files right with her and in the hierarchy of their original folder.

    I'm mystified and have given up trying to remove these things. Fortunately, the removal of messages from other folders and empty the trash of these messages seem to work normally. I have not yet tried to delete another folder and hesitate to do.

    Thank you
    Chuck Norcutt
    Murrells Inlet, SC

    Thank you very much. Exactly, that solved the problem. There was almost no delay in starting. I'm still very curious as to how it happened, but it may never be known.

  • Play 'trueSound' or 'falseSound' with drag and drop symbol

    Hello

    for a small animation, I want to play its true, when the player's response is good

    -Label of drag player on an image, if the label is in a good place "real sound" is a game (= "coq07"), I have a solution for this

    But if the player drag the label on a false position I want to play 'true sound', and I don't know how it is!

    Can you help me?

    Thanks a lot ;-)

    I use this code:

    yepnope ({nope: ['jquery-ui - 1.10.4.custom.min.js ',' jquery.ui.touch - punch.min'], complete: init});

    function init() {}

    Draggable BRAIN-1

    SYM. $('cerveau_1') .draggable ({opacity:. 5, return: 'invalid'});

    Droppable on target

    SYM. $('targetCerveau_1').droppable({)

    Accept:sym.$('cerveau_1'),

    Drop: function() {}

    sym.getSymbol ("cerveau_1");

    Audio var = sym.$("coq07") [0];

    audio.currentTime = 0;

    If {(audio.paused)

    audio. Play(); }

    }

    }

    );

    SYM. $('defaultCerveau_1').droppable({)

    Accept:sym.$('cerveau_1'),

    Drop: function() {}

    }

    }

    );

    Draggable MOUTH-2

    SYM. $('bouche_2') .draggable ({opacity:. 5, return: 'invalid'});

    Droppable on target

    SYM. $('targetBouche').droppable({)

    Accept:sym.$('bouche_2'),

    Drop: function() {}

    sym.getSymbol ("bouche_2");

    Audio var = sym.$("coq07") [0];

    audio.currentTime = 0;

    If {(audio.paused)

    audio. Play(); }

    }

    }

    );

    SYM. $('defaultBouche').droppable({)

    Accept:sym.$('bouche_2'),

    Drop: function() {}

    }

    }

    );

    ...

    Capture d’écran 2014-03-06 à 21.58.45.jpg

    Hello

    The incorrect drop, you can call your function that would play the wrong sound track. I have attached a sample which is currently recording a little "wrong drop" in the console when the black box fell on red square or white circle fell on the green square.

    Similarly, in your case for

    SYM. $('cerveau_1') .draggable ({{opacity:.5, revert: function (valid)}})

    if(!valid)

    {

    Enter the code to play the wrong sound.

    }

    return! valid;

    }

    });

    Thank you and best regards,

    Roger Simon

Maybe you are looking for