The American flags planted on the Moon are attached on their side to a vertical flagpole, and they are also attached at the top by a horizontal crossbar. They were hung in such a way that the crossbars are not generally visible in the photographs taken by the Apollo astronauts, although the crossbars can be seen if you look carefully. Also, when a flag is planted on the Moon, the vibrations traveling through the flagpole will temporarily cause the cloth flag to shake and wave. Those motions will last for quite a while because there is no air resistance on the Moon to slow them down.