Water / Liquid Filling Effect

Hi guys,

Anybody knows how to simulate the water filling effect by using FLASH and use it as a mask over a text content.

I’ve search around Kirupa forum, i have this code from stermer which is used to create a sine wave with fill underneath it

NbrControlPoints = 20;
StartX = 0;
EndX = Stage.width;
BottomY = Stage.height;
WaterLevel = Stage.height / 2;
WaveHeight = 30;
WaveSpeed = .0005;
mc.onEnterFrame = function() { 
 this.clear();
 this.beginFill(0xFE9919, 100);
 this.moveTo(EndX, BottomY);
 for (x = 0; x < NbrControlPoints; ++x) {
  var r = x / (NbrControlPoints - 1);
  px = EndX + r * (StartX - EndX);
  py = WaterLevel + WaveHeight * Math.sin(r * Math.PI * 2 + getTimer() * WaveSpeed);
  this.lineTo(px, py);
 }
 this.lineTo(StartX, BottomY);
 this.lineTo(EndX, BottomY);
 this.endFill();
};

attemping to use this as a mask over a picture, all I can see is the sine wave it self. Any ideas ?

thanks.