Elastic Effect

Hi everyone.
Have a quick question.
I want to make an elastic effect which basically does.

  1. You can drag an object outwards from a point, when you release, the objct will bounce back to the point, BUT, orbit around the point in an arc motion, then release., kind of like a slingshot effect. then pull back towards that point again and repeat.
  2. if the object is pulled within the orbit area, then the object simply catapults around the point and elastic back.

i’ve used code like so

var dist_x:Number = orb2.x-orb1.x;
            var dist_y:Number  = orb2.y-orb1.y;
            var actual_distance:Number = Math.sqrt(dist_x*dist_x+dist_y*dist_y);
            var error_on_1st:Number = 1.0;

            var error:Number = actual_distance - 100;

            orb1.x = 300;
            orb1.y = 300;    
            //Spring orb2 to orb1

            orb2.vy += ((orb1.y - 120)- orb2.y) * spring;
            orb2.vx += (orb1.x - orb2.x) * spring ;
            orb2.vx *= damping;
            orb2.vy *= damping;
            
        
            orb2.x += ((error*error_on_1st)* Math.sin(-Math.atan2(dist_x, dist_y)));
            orb2.y -= ((error*error_on_1st)* Math.cos(-Math.atan2(dist_x, dist_y)));
                        
            //orb1.x += ((error*error_on_2nd)* Math.sin(-Math.atan2(dist_x, dist_y)));
            //orb1.y -= ((error*error_on_2nd)* Math.cos(-Math.atan2(dist_x, dist_y)));
            
            orb2.x += orb2.vx ;
            orb2.y += orb2.vy;

so when you pull orb2, it will pull away, then when you release with the mouse, it bounces back towards orb 1. It does this but keep going in the reverse direction like an elastic collision, which is good. Instead I want it to orbit lets say to the opposite side of the orb1, then elastic away from point 1, then back to point 1, until it looses momentum and settles at the initial starting point.

Thanks for any help.