First frame, energy does not match permitted level.   Second frame energy does match and is absorbed so the electron is meta-stable in the third frame.  After a while the meta-stable state the electron returns to the lower energy state and releases a photon.