A study of gamma-ray burst afterglows as they first come into view of the swift ultraviolet and optical telescope