Jump to content
Search Community

dudetteontheedge

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by dudetteontheedge

  1. I cannot get this to work. I suppose I need the plugin before it works, right?

    Also another question:

    I added the function directly on the onDrag because I have something else going on with it. 

    Adapted code below:

    sym.$("info").hide();
    var smallWheel = sym.$('smallWheel');
    var bigWheel = sym.$('bigWheel');
    
    var rotationSnap = 45;
    Draggable.create(smallWheel, {
    	type:"rotation", 
    	throwProps:true,
    	snap:function(endValue) { 
            return Math.round(endValue / rotationSnap) * rotationSnap;
       },
       onDrag :function() { 
    		sym.$("rattle")[0].play();
    		sym.$("info").hide();
    		TweenLite.set(bigWheel, {rotation:smallDraggable.rotation});
    	},	
    
    	//onDrag: syncBigWheel,
    	onThrowUpdate: syncBigWheel,
    	onDragEnd: function(){
    		sym.$("rattle")[0].pause();
    		sym.$("info").show();
    	}
    });
    var smallDraggable = Draggable.get(smallWheel);
    function syncBigWheel() {
      TweenLite.set(bigWheel, {rotation:smallDraggable.rotation});  
    }
    
    
  2. I am working in edge animate version 2014

     

    I am wondering if it is possible to have one wheel start spinning in sync with another wheel when it is dragged. I would like these wheels to be synchronized.

     

    post-18834-0-46498900-1405011114_thumb.png

     

    Next - I added sound but when the wheel is released the sound does not stop.

    Below is my code:

    
    var smallWheel = sym.$('smallWheel');
    var bigWheel = sym.$('bigWheel');
    Draggable.create(smallWheel, {
    	type:"rotation", 
    	throwProps:true,
    	onDrag :function() { 
    		sym.$("rattle")[0].play();
    		Draggable.create(bigWheel, {type:"rotation", throwProps:true});
    	},
    	onRelease :function(){
    		sym.$("rattle")[0].pause();
    	}
    });
    
×
×
  • Create New...