Creating OS X Dock-type animation using shape

I’m looking to create an effect similar to how the dock grows in OS X when a user rolls over a particular area of a gradient. Basically, I’d like to draw a gradient on the bottom of the stage, then depending on where the user moves the mouse, the top path of the gradient bows out a bit to follow the mouse’s x location.

Has anyone seen any sample code to create this type of effect or done anything similar? If not, can anyone help me get started?