This little cloth physics simulator was one of the first bits of 'Custom Logic' on the web.
It was written all the way back in the days of Flash 7 (before we had Actionscript 3, drawing functions, 3D libraries, or indoor plumbing).
Amazingly, it still holds up pretty well.
try it here