6 Replies Latest reply on Aug 13, 2015 5:31 PM by pittsburgh_joe

    How to add a calculation function to dragged objects in Edge Animate?

    The Arthematics Level 1

      Hi guys! Need your help! I need to connect the knob rotation and animation of numbers in Adobe Edge Animate, I did the dragged knob, and don't know how to do the rest ...

      Add some scrins:

      1.jpg2.jpg


      and Edge Animate files Dropbox - dc_power_supply_animate.zip to better explain what I mean

      Rotation of knob made with GreenSock's "Draggable" plugin. And there is some help I get from GreenSock:

      Drag and Spin Demo


      and this code:


      Draggable.create(".dial", {

      type:'rotation',

      bounds:{minRotation:0,maxRotation:360},//set min/max range limitation

      throwProps:true ,

      onDrag:Calc ,

      onThrowUpdate: Calc // if you want to use ThrowProps you need onThrowUpdate fn to run your function on throwing

      });

       

       

      function Calc(){

        console.log( this.rotation )

      // you can do any math calc with " this.rotation " to get your desire range number like : this.rotation/360

      var R = this.rotation/360 ;

      document.getElementById(" myText ").innerHTML= R ;

      }

       

      But I can't take it into Edge Animate to make a whole animation

       

      Thanks in advance for any help! Regards

      Misha.