You can't use the physic engine for this ?
Well thats the plan eventually, but physics in waving flags is not high on the priority list, so I made this so we have something in between. (Grass and trees moving are done with other tricks. Not physics.)