Share Posted December 19, 2014 Is it possible to create a hovering effect on an object using a Green Sock Solution? Instead of a static button I would like to have a button that looks like it is hovering. 1 Link to comment Share on other sites More sharing options...
Share Posted December 20, 2014 Not exactly sure what you are looking for but start with this place a clip with instance name mc on the stage and add this code import com.greensock.*; //record start position so that the mc never moves too far away from its origin var startX = mc.x; var startY = mc.y; //move random 4 pixels function move():void { //create a random tween and call this function again when its done TweenLite.to(mc, 0.6, {x:startX + Math.random()*5, y:startY + Math.random()*5, onComplete:move}); } move(); Link to comment Share on other sites More sharing options...
Author Share Posted December 21, 2014 Thanks Carl. I will try it out. Link to comment Share on other sites More sharing options...
Author Share Posted December 24, 2014 Carl, I tried it and its close to what I want but I need it to be smoother. I will play with the values. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now