Imagine you’re an 18-year-old musical theater geek and aspiring actor with no experience, and out of nowhere, you’ve landed a lead role in a new Broadway musical written by Stephen Sondheim and directed by Hal Prince. You’re euphoric. You’ve achieved your dream in life. This is it!

But now imagine how you’d feel if the show were to close practically overnight, leaving you back at square one, with no guarantee you’ll ever make it to Broadway again. How can you possibly move on professionally or emotionally?

In the backstage documentary “Best Worst Thing That Ever Could Have Happened,” actor-director Lonny Price recalls what it was like to be a part of “Merrily We Roll Along,” which crashed and burned in its 1981 Broadway debut.

Following its premiere at the New York Film Festival last month, the documentary will be screened at the Film Society of Lincoln Center and the IFC Center beginning Friday.

Like so many other musical theater-loving teens of his generation, Price was enamored with the canonic 1970s musicals of Sondheim and Prince (i.e. “Company” through “Sweeney Todd”). It seemed unfathomable that “Merrily” was not going to be a major hit. The rehearsal period was apparently a joyful experience. But then previews began and audience members walked out.

Since “Merrily” depicts how idealistic teens lose track of their dreams and turn into jaded adults (and does so in reverse chronology), Prince decided to cast high school and college-age actors. It was an inspired concept that stumbled badly in execution, and the resulting production looked sloppy and amateurish.

Price skillfully combines archival footage depicting the show’s audition and rehearsal process (apparently salvaged from a never-aired TV documentary) and selections from the original cast album with interviews of Sondheim, Prince and the other cast members (including Jason Alexander, Terry Finn, Tonya Pinkins and Jim Walton).

The second half of the 95-minute film (consisting of profiles on what the actors are doing now with their lives) is drawn out and depressing. It may have been better to focus on the significant afterlife of “Merrily,” which has undergone textual revisions and is now frequently revived.

But on the whole, this is an engrossing and poignant tribute to a challenging musical and the challenges faced by actors of all ages. As they say, “there’s a broken heart for every light on Broadway.”