# Water / Liquid Filling Effect

**URL:** <https://forum.kirupa.com/t/water-liquid-filling-effect/192518>\
**Category:** flash\
**Created:** [June 29, 2006, 3:12am UTC](https://forum.kirupa.com/t/water-liquid-filling-effect/192518 "2006-06-29T03:12:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kenvunz](https://avatars.discourse-cdn.com/v4/letter/k/c5a1d2/32.png) [@kenvunz](https://forum.kirupa.com/u/kenvunz)\
**Post date:** [June 29, 2006, 3:12am UTC](https://forum.kirupa.com/t/water-liquid-filling-effect/192518/1 "2006-06-29T03:12:06Z")

</div>

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

```auto
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.
