Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

Coincidental Draggable

$
0
0

Hello,

I'm making an interactive analog clock using Adobe Edge. The hands of the clock can be dragged to any particular time. When dragged, the movement of the hands coincide with each other. I was able to code the "hour" hand that when dragged the "minute" hand moves accordingly (with 12 times the rotation). I used GreenSock's GSAP and it works flawlessly (see code below).

 

 

var hourHand = sym.$('Clock_H');

var minHand = sym.$('Clock_M');

 

Draggable.create(hourHand, {

  type:"rotation",

  throwProps:true,

  onDrag: syncMinHand,

  onThrowUpdate: syncMinHand

} )

var hourDraggable = Draggable.get(hourHand);

function syncMinHand() {

  TweenLite.set(minHand, {rotation:hourDraggable.rotation * 12});

}

 

 

However, I want to be able to accomplish the same effect for the "minute" hand. When the "minute" hand is dragged the "hour" hand moves accordingly (12 times slower). But I want to be able to independently move either hand at any point with the other hand corresponding appropriately. Any help is greatly appreciated!


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>