7 Replies Latest reply on Aug 12, 2014 9:31 AM by Preran

    Drag and drop counter which activates a animation when certain number is reached

    The shizzolator

           Hi there guys, I was wondering if anyone could help me with this problem, I'm using adobe edge to create a drag and drop game and I want edge to use a counter to track how many draggable parts have been dropped in their repective targets, when a certin number of elements have been dropped I would like edge to automaticly reveal a button so the user can move on. I have the code and I think I may be on the right track but I may be miss placing some code

       

      Any help woud be great

       

         // insert code to be run when the symbol is created here

               yepnope({nope:['jquery-ui-1.10.4.custom.min.js', 'http://code.jquery.com/jquery-1.11.0.js'], complete: init});

              

              

              

               function init(){

                         //Use the code! Draggable! Droppable!!

                         sym.$('Leftpole3').draggable({opacity:.5, revert:'invalid'});

              

                         sym.$('Leftpole2').draggable({opacity:.5, revert:'invalid'});

              

                         sym.$('Leftpole1').draggable({opacity:.5, revert:'invalid'});

              

              

                         //Droppable

                         sym.$('Leftpole3target').droppable({

                                   accept:sym.$("Leftpole3"),

                                   drop: function () { 

                                                        sym.setvarible("count", count + 1)

                                   sym.getSymbol("Leftpole3").play();  

                         }

                         }

               );

       

       

                         sym.$('defaultpole3').droppable({

                                   accept:sym.$("Leftpole3"),

                                   drop: function () {

       

       

       

       

                         }

                         }

                         );

       

       

       

       

                         sym.$('Leftpole2target').droppable({

                                   accept:sym.$("Leftpole2"),

                                   drop: function () {

                                                        sym.setvarible("count", count + 1)

                                                        sym.getSymbol("Leftpole2").play();

                         }

                         }

               );

       

       

                         sym.$('defaultpole2').droppable({

                                   accept:sym.$("Leftpole2"),

                                   drop: function () {

                         }

                         }

                         );

       

       

                         sym.$('Leftpole1target').droppable({

                                   accept:sym.$("Leftpole1"),

                                   drop: function () {

                                                        sym.setvarible("count", count + 1)

                                   sym.getSymbol("Leftpole1").play();

                         }

                         }

               );

       

       

                         sym.$('defaultpole1').droppable({

                                   accept:sym.$("Leftpole1"),

                                   drop: function () {

       

       

               }

               }

               );

       

       

               // Set the value of a Symbol variable

               sym.setVariable("count",0);

       

       

       

       

       

       

               if("count"==3) {

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

       

       

       

       

               }

               }