Waving shape effect

Hi, I want to make AS 3 effect, that looks like sine wave goes through circle or another closed shape. This morphing shape I want to use as mask lately. Shape morphing should look something like this image

I know that function curveTo() is used to create this effect.
I’ve seen this effect in the net, but now cannot find it. Maybe anyone can help me?