The nonlinear optical properties of a functionalized poly(thiophene azine), namely, poly(3,4-didodecylthiophene azine), PAZ, at the optical telecommunication wavelength of 1550 nm are investigated by means of the closed-aperture z-scan technique in both thin films and solutions. Values of chi((3))=(2.4+/-0.4)x10(-13) esu, n(2)=(4.0+/-0.7)x10(-15) cm(2) W(-1), and gamma=(4.5+/-0.7)x10(-34) esu are estimated for the third-order (Kerr) susceptibility, the intensity-dependent refractive index, and the molecular second hyperpolarizability of solution samples, respectively. A very small dependence on the polymer chain length is found. Markedly higher values of (4.4+/-1.1)x10(-11) esu, (6.6+/-1.0)x10(-13) cm(2) W(-1), and (5.0+/-0.8)x10(-33) esu are measured for the corresponding quantities in thick (up to 20 mum) polymer films cast on quartz plates. The enhancement of the NLO responses on going from solution to solid samples is attributed to a partially ordered structure and to the presence of interchain interactions leading to greater pi-electron delocalization in the cast polymer films. The results are compared with those previously obtained by using third-harmonic generation (THG), taking into account that those data were measured under conditions of three-photon resonance, whereas our z-scan measurements are fully off-resonance.