I created a quick prototype of a realtime liquid simulation for a project over at Chiat a couple weeks ago. The result might not be very realistic, a little cartoony you might say, but it’s definitely fun to play with (any program that features real-time physics just fascinates me). I made a quick demo to show you how it’s done.
It was a little tricky to create the physics bottle that would hold the particles. The easiest way I found was to put movieclips on stage in the shape of the bottle and loop through each pieces and create a corresponding APE RectangleParticule. The tricky part is that when you rotate a movieclip in Flash, the height and width of the clip changes, so i had to nest a movieclip within to be able to read the correct height and width of the particle.