He next starred in Sonny, a 2002 release in which he was directed by fellow actor Nicolas Cage, whose involvement had attracted Franco to the film. Set in 1980s New Orleans, Sonny follows the titular character (Franco) returning home after just being discharged from the Army. To prepare for his role, he met with sex workers or people who had previously been prostitutes. The movie was panned by critics, with the New York Post's Lou Lumenick calling it an "instant candidate for worst movie of the year". Franco was cast as a homeless drug addict in the drama City by the Sea (2002) after co-star Robert De Niro saw a snippet of his work in James Dean. He lived on the streets for several days to better understand the subject matter as well as talking to former or still-using drug addicts. He also co-starred with Neve Campbell in Robert Altman's ballet movie The Company (2003). The success of the first Spider-Man film led Franco to reprise the role in the 2004 sequel, Spider-Man 2. The movie was well received by critics, and it proved to be a big financial success, setting a new opening weekend box office record for North America. With revenue of $783 million worldwide, it became the second highest-grossing film in 2004. The following year he made and starred in the black comedy The Ape and the 2005 war film The Great Raid, in which he portrayed Robert Prince, a captain in the United States Army's elite Sixth Ranger Battalion. In 2006, Franco co-starred with Tyrese Gibson in Annapolis and played legendary hero Tristan in Tristan & Isolde, a period piece dramatization of the Tristan and Iseult story also starring British Actress Sophia Myles. For the former, he did eight months of boxing training and for the latter, he practiced horseback riding and sword fighting. He then completed training for his Private Pilot Licence in preparation for his role in Flyboys, which was released in September 2006; the same month, Franco appeared briefly in The Wicker Man, the remake of the seminal horror film. Also in 2006, he made a cameo appearance in the romantic comedy The Holiday.