Make
sure that all selected objects already use a gradient.
In the Toolbox, select the Fill box or the Stroke box.
Select the Gradient tool , and
position it where you want to define the beginning point of the
gradient. Drag across the object in the direction you want the gradient
to be applied. Hold down Shift to constrain the tool to multiples
of 45°.
Release the mouse button at the place where you want
to define the endpoint of the gradient.
Default gradient fill (left) and gradient applied across objects
(right)
If a compound path with
a gradient is selected, you can edit the gradient across all of
its subpaths by using the Gradient panel alone, without having to
use the Gradient tool.