HELP! mouse follower within a guideline

I`m wondering how if you could tell me how to make an object to follow the mouse but not just as it’s seen everywhere. I mean, I need an object to follow the mouse within a guide line and I have no idea of how to figure it out.

See this sample by http://www.peterjoel.com/