1 Reply Latest reply on May 20, 2016 6:25 AM by kglad

    Flash cs6 as2 drag and drop game help

    macauleyk64206489

      Im trying to create a reset button for my drag and drop game any help into how to do this? (AS2)

        • 1. Re: Flash cs6 as2 drag and drop game help
          kglad Adobe Community Professional & MVP

          at your game's start, assign each draggable object its starting position.  eg,

           

          function initF(){

          for(var i:Number=0;i<draggable_objectsA.length;i++){

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

          draggable_objectsA[i].startY=draggable_objectsA[i]._y;

          }

          }

           

          then whenever you want to reset:

           

          function resetF():Void{

          for(var i:Number=0;i<draggable_objectsA.length;i++){

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

          draggable_objectsA[i]._y=draggable_objectsA[i].startY;

          }

          }