Using three-dimensional time-domain numerical simulations of the nonlinear dispersive Maxwell equations for a defect microcavity in a photonic crystal wire, we show that the transmission through the bandgap can be all-optically modulated via the generation of transient states associated with the nonlinear splitting of the defect mode. Analytical results based on time-domain coupled-mode theory are derived as well.