It’s a story on one hand about divorce, but it’s really a love story and the story of marriage,” said Noah Baumbach, whose film “Marriage Story,” was shown at the New York Film Festival last Friday. The film follows the uncoupling of two characters played by Scarlett Johansson and Adam Driver.

Mr. Baumbach, whose best-known film, “The Squid and the Whale,” was also about the breakup of a marriage, has some experience with the subject (he is divorced from Jennifer Jason Leigh). And many cast members have been divorced as well.

Did they have any advice to share about building a happy marriage?

“Healthy relationships, I’ve found, require a lot of compassion,” said Ms. Johansson (two divorces). “That’s the secret ingredient.”

Laura Dern, a supporting actor in the film, (one divorce), said: “The one that I think most people don’t get right is to be honest.”

Alan Alda, another supporting actor (married 62 years, no divorces), said: “My wife has a very good system. She says the secret of a long marriage is a short memory.”

Mr. Driver, who is also going strong on his first marriage, offered no advice. He arrived one minute before showtime, barely stepped onto the red carpet, and posed for a minimum of pictures; no interviews. Clearly, it’s not just onscreen that he knows how to flex his muscle.

Cast members including Ray Liotta, Julie Hagerty and Wallace Shawn later hit the after-party at Tavern on the Green. In the mild fall night, guests dined on beef loin and charcuterie under ropes of lights strung above trees in the garden.

Inside, Julianne Moore and Greta Gerwig (Mr. Baumbach’s girlfriend), mingled as David Kuhn, the literary agent, chatted with writers including Sloane Crosley and Elizabeth Spiers.

“Wow, this is gorgeous,” Ms. Johansson said, stepping into the baronial front bar. Did she think “Marriage Story” would have worked dramatically if its protagonists had not gotten divorced?

“It would not have made a film,” she said. “At least, it would not have made a Noah Baumbach film.”

“Slave Play,” which opened at the Golden Theater on Broadway Sunday night, examines contemporary racism through couples participating in fetishistic sexual role play. That premise proved something of a minefield for stars who attended the opening night performance.

Rachel Brosnahan, the titular star of “The Marvelous Mrs. Maisel,” came first. How does she feel about interracial, S-and-M sex?

“I’m all for it,” she said. “Yay!”

Has she tried it? “I’m going to leave it at that.”

George Takei, the actor, was unfazed by the subject matter. “My hubby is white, we have sex,” he said. “I believe in diversity coming together.”

Jake Gyllenhaal, a producer of the show, was more circumspect. “I always want to be a part of great art, and I always wish I was up onstage when it’s fantastic,” he said. Wisely, he did not take follow-up questions.

Jeremy O. Harris, who wrote the play, arrived late in a blue velvet Gucci jacket and lace shirt. He seemed to relish the ticklish conversations his work was provoking. “I wanted to make a thing that wouldn’t not be talked about,” Mr. Harris said. “We haven’t processed the original sin of our country. It’s a slave play. There’s a history of this.”

Others in the audience included Tom Hiddleston, Ansel Elgort, Maggie Gyllenhaal, Andre De Shields, Zazie Beetz, Tommy Dorfman, Molly Ringwald, Mark Ronson, Cory Michael Smith, Emily Ratajkowski, Bowen Yang and Kehinde Wiley.

In the preshow hubbub of the red carpet, Jason Ralph, the Broadway and television actor, played a prank on Ms. Brosnahan, his wife. He sneaked up behind her, pretending to be a reporter hectoring her for an interview.

A little couple’s role play, perhaps? “I’m learning something,” he said with a grin.