11 Replies Latest reply on Jan 11, 2015 10:06 AM by jamesfootlight

    Is it possible to have a droppable event happen just once?

    jamesfootlight Level 1

      Hi,

       

      I have a character that when entering a droppable area, triggers an animation to occur. However, I only want this to happen once and not every time my character enters the droppable area, can you help me to achieve this?

       

      here is my code:

       

      var container = sym.$("container");

       

       

        sym.$("ALF").draggable({ containment: container });

       

       

      sym.$('ALF').draggable({

            start: function() {

             sym.getSymbol('ALF').play();

       

       

       

       

       

       

             // Play an audio track

             sym.getSymbol("walkSound").$("step")[0].play();

           },

       

       

       

       

           stop: function() {

              sym.getSymbol('ALF').stop();

              sym.getSymbol("walkSound").$("step")[0].pause();

            }

      });

       

       

        //Droppable... on the target!

        sym.$('DOCKSPACE').droppable({drop: function() {sym.getSymbol("SUBRISE").play();}});