A new technique for measuring the mechanical properties of thin films