I saw your other thread earlier but didn't have time to reply.
If you're making it the same as the game in the youtube video, as in, the pieces are already on the board just ready to be rotated, then it's quite simple.
You place all the pieces in the layout editor to make the final result. Place them in the order you want the flow.
Use an array to store the angle of each object (ordered).
On start of layout, go through each piece and assign a random angle - choose(0,1,2,3) * 90. This will jumble the angles.
To check if they're connected, loop through each object and see if it's the correct angle as its array counterpart. Stop looping at the first wrong angle. That's where the water will be up to so just change the frame of each object that is correct, to that of the water filled piece. Do this everytime a shape is rotated. Shouldn't be that much of a performance hit, if any.
You'll need to have rules based on which way the water will flow (you'll most likely need 2 different animations showing the flow of water from edge A to edge B, and one to show edge B to edge A).
It's a little bit more work than that, but that's the method that pops into my head when I watch the video.
My mind is a bit foggy otherwise I'd have a crack at it. Maybe tomorrow.. ;)
Hopefully that gives you some ideas.