Preloader question

Hello anyone. I’m looking for a tutorial or source files for a preloader I want to build. Preferably a tutorial. I want to make a preloader that is connected to an animation. I don’t want an animation that is just looping on its own time. I want the animation to move according to how much has loaded. So let’s say I had a vector cup graphic and i want it to slowly fill up with water. So when 50% was loaded the cup would be 50% full. Can anyone point me in the right direction? Thank so much for your help.

example: https://store.beamjive.com/demos.php - see BJC PRELOADER SET 2