The Swift satellite has enabled us to follow the evolution of gamma-ray burst (GRB) fireballs from the prompt γ-ray emission to the afterglow phase. The early-time X-ray and optical data for GRBs obtained by telescopes aboard the Swift satellite show that the source for prompt γ-ray emission, the emission that heralds these bursts, is short lived, and is distinct from the source for the long-lived afterglow emission that follows the initial burst. Using these data we determine the distance of the γ-ray source from the centre of the explosion. We find this distance to be 1015–1016 cm for most bursts, and show that this is within a factor of about 10 of the radius of the shock heated circumstellar medium (CSM) producing the X-ray photons. Furthermore, using the early γ-ray, X-ray and optical data we show that the prompt gamma-ray emission cannot be produced in internal shocks nor can it be produced in the external shock; in a more general sense γ-ray generation mechanisms based on shock physics have problems explaining the GRB data for ten Swift bursts analyzed in this work. A magnetic field dominated outflow model for GRBs has a number of attractive features, although evidence in its favour is inconclusive. Finally, the X-ray and optical data allow us to provide an upper limit on the density of the CSM of about 10 protons cm−3 at a distance of ∼5 × 1016 cm from the centre of explosion.