The layer-by-layer assembly technique is a method that widely used in the preparation of nanostructured multilayer ultrathin films. We fabricated a hydrogel nanocomposite film by alternating the deposition of a core–shell poly[(dimethylimino)(2-hydroxy-1,3-propanedily) chloride] (PDMIHPC)–laponite solution and poly(acrylic acid). The growth of the deposition procedure was proven by ultraviolet–visible spectroscopy and spectroscopic ellipsometry. The surface morphology of the films was observed by scanning electron microscopy. The films could reversibly load and release methylene blue (MB) dye, which was used as an indicator. It took about 4.5 h to reach loading equilibrium at pH 9.0. The loading capacity of the film for MB was as large as 4.48 μg/cm2 per bilayer because of the introduction of the core–shell PDMIHPC–laponite as a film component. Nearly 90% of MB was released at pH 3.0 or in a 300 mM NaCl solution within 2.5 h. The loading and release processes were greatly influenced by the ionic strength and pH value of the MB solution. The hydrogel nanocomposite film showed good pH-triggered loading-release reversibility and suggested potential applications in controlled drug-delivery systems and smart materials. © 2013 Wiley Periodicals, Inc. J. Appl. Polym. Sci. 2014, 131, 39352.