Let K be a function field, let φ ∈ K(T) be a rational map of degree d ≧ 2 defined over K, and suppose that φ is not isotrivial. In this paper, we show that a point P ∈ ℙ1 () has φ-canonical height zero if and only if P is preperiodic for φ. This answers affirmatively a question of Szpiro and Tucker, and generalizes a recent result of Benedetto from polynomials to rational functions. We actually prove the following stronger result, which is a variant of the Northcott finiteness principle: there exists ε > 0 such that the set of points P ∈ ℙ1 (K) with φ-canonical height at most ε is finite. Our proof is essentially analytic, making use of potential theory on Berkovich spaces to study the dynamical Green's functions g
φ, υ (x, y) attached to φ at each place υ of K. For example, we show that every conjugate of φ has bad reduction at υ if and only if g
φ, υ (x, x) > 0 for all , where denotes the Berkovich projective line over the completion of
υ. In an appendix, we use a similar method to give a new proof of the Mordell-Weil theorem for elliptic curves over K.