creating a flash on the fly