Fox's big break came when she acquired the lead female role of Mikaela Banes in the 2007 live-action film Transformers, based on the toy and cartoon saga of the same name. She played the love interest of Shia LaBeouf's character Sam Witwicky. In June 2007, Fox was cast in How to Lose Friends & Alienate People, starring alongside Jeff Bridges, Simon Pegg and Kirsten Dunst.