AhemExcuseMe - i tried doing this some time ago (trying to make legs that walked) but was very unsuccessful due to the odd workings of physics and revolute joints.
i tried to make an example of this using physics and joints but after fiddling with it for some time i decided that simulating a hydraulic joint was much easier than trying to get the picky revolute joint system to work. sometimes the joints of the arm piece would get "pushed out" of where its joint was (attached to the base), and when changing the height of the arm it didn't push the upright piece like i had thought it would.
here's what i came up with:
dropbox.com/s/7cv9qr7910xaoh8/hydraulicarms.capx
if you want to try and fiddle with it, remove the pin behaviour from the arm1, add physics back and update the event sheet to reinclude revolute joints. maybe you will have some ideas that i did not!
i did learn a new expression that may or may not help with my legs project though <img src="smileys/smiley36.gif" border="0" align="middle" />