First-order phase transitions in ferroelectric films