That vector potentials have a direct significance to quantum particles moving in magnetic fields is known as the A–B (Aharonov–Bohm) effect. We study scattering by two solenoidal magnetic fields (point-like magnetic fields) in two dimensions and analyze the asymptotic behavior of the scattering amplitude in the semiclassical limit. The corresponding classical mechanical system has a trajectory oscillating between the centers of the two fields. We derive the asymptotic formula with the first three terms and make clear how such a trapping trajectory is reflected in the asymptotic formula through the A–B effect. We also make a brief comment on an extension to the scattering by many solenoidal fields. The result depends on the location of the centers of the fields. In particular, the A–B effect appears strongly when the centers are on an even line.