We discuss the opacity in the core regions of active galactic nuclei observed with Very Long Baseline Interferometry (VLBI), and describe a new method for deriving the frequency-dependent shifts of the VLBI core from the frequency-dependent time lags of flares observed with single-dish observations. Application of the method to the core shifts of the quasar 3C 345 shows a very good agreement between the core shifts directly measured from VLBI observations and derived from flares in the total flux density using the proposed method. The frequency-dependent time lags of flares can be used to derive physical parameters of the jets, such as distance from the VLBI core to the base of the jet and the magnetic fields in the core region. Our estimates for 3C 345 indicate core magnetic fields ~0.1 G and magnetic field at 1 pc ~0.4 G.