We studied the spatial dynamics of the flaring loop in the 2005 August 22 event using microwave (NoRH) and hard X-ray (RHESSI) observations together with complementary data from SOHO/MDI, SMART at Hida, SOHO/EIT, and TRACE. We have found that (1) the pre-flare morphology of the active region exhibits a strongly sheared arcade seen in Hα and the J-shape filament seen in EUV; (2) energy release and high-energy electron acceleration occur in a sequence along the extensive arcade; (3) the shear angle and the parallel (to the magnetic neutral line) component of the footpoint (FP) distance steadily decrease during the flare process; (4) the radio loop shrinks in length and height during the first emission peak, and later it grows; after the fourth peak the simultaneous descending of the brightest loop and formation of a new microwave loop at a higher altitude occur; (5) the hard X-ray coronal source is located higher than the microwave loop apex and shows faster upward motion; (6) the first peak on microwave time profiles is present in both the loop top and FP regions. However, the emission peaks that follow are present only in the FP regions. We conclude that after the first emission peak the acceleration site is located over the flaring arcade and particles are accelerated along magnetic field lines. We make use of the collapsing magnetic trap model to understand some observational effects.