So, years ago I had a similar question and Dan Ebberts answered it, but I can't find the expression and I don't have the AE project anymore. So let's try this again...
Imagine you've got a piece of fabric attached to the end of a pole (like a streamer). When you move the pole to your left the streamer flows (is blown by wind, whatever) out to the right and vice/versa (trailing behind the movement and speed of the end of the pole). Everyone with me so far?
So when layer A moves left or right, layer B "flows" behind it, affecting it's rotation to do so (its anchor point attached somewhere on layer A).
When layer A comes to a stop, layer B, would rotate back down to 0 (or whatever it's "resting" rotation value is). Ideally it would ease back in to that "resting" rotation.
The faster layer A moved, the quicker layer B would "flow" up in it's rotation (maybe with a little wiggling as if a breeze for good measure)
Does this make sense?
What would be the best way to do this? I've got a lot of little pieces and I'm hoping not to animate it all by hand.
Julius Caesar and the Roman Empire couldn't conquer the blue sky.
When the flag follows the pole, the orientation of the flag depends on the velocity of the pole. To achieve this with expression, you can use the expression attached below for the Orientation property.
Maybe this is only a small part of what you need, but hope it helps.