Help with animating a wire being plugged into socket

Hi there,

I’m trying to animate this scene where the plug at the end of a blue wire would snap-in to the white colored socket. Its a simple process, but the tricky part is that I have to make it interactive. In other words, the user has to mouse-click on the plug and drag it close to the white box where the plug automatically snaps in place.

I also need to make the blue-colored wire flexible/bendable to follow the mouse’s movement. i’m thinking bones, but don’t know how to mate it with the mouses’ movement. And I’m rather clueless about ActionScript 3.

I’d be grateful if you could offer assistance (as detailed as possible, please?) for this 2 actions.