There are only two ways to get to Neverland: learning to fly or going to see “Peter Pan.”

For those who prefer the latter, the story of the boy who refuses to grow up opened this week at Beverly’s North Shore Music Theatre, where the actors will do all the flying through Sunday, July 22.

“I’m fighting with Hook and flying, flying with the kids, flying on my own,” said Elena Ricardo, who plays the lead role. “You’re going to see a fair amount of flying, for sure.”

Flight is the perfect metaphor for freedom, and in “Peter Pan,” that means being free to behave as if life were a summer camp where children are in charge.

The musical begins when Peter offers to teach John, Michael and Wendy Darling — three children from a typical family — how to fly, so they can follow him to Neverland and share his adventures.

The story by J.M. Barrie first appeared as a play in 1904, then was turned into a musical starring Mary Martin in 1954. It typically features a woman in the lead role.

“I don’t know why it’s always been played by females,” Ricardo said. “There’s an agility and a grace that only a woman could bring. Every girl wants to play Peter Pan.”

Ricardo, who starred as Sophie Sheridan in “Mamma Mia!” on Broadway in 2014, thinks the musical version of “Peter Pan” is suited to a woman’s voice, because “the score sits in a more female-friendly place.” 

She also thinks it makes sense to have a grown woman play Peter Pan, because that highlights the character’s main conflict.

“It’s all about not growing up,” Ricardo said. “I think seeing an adult resisting growing up” is more dramatic. 

Ricardo honed her agility during 10 years of competing as a gymnast, like Olympian Cathy Rigby, who played Peter Pan for decades. Among the accomplishments listed on Ricardo’s résumé are the fact that she holds a record for pushups, having done 81 in one minute in seventh grade. 

“I was prepubescent, 80 pounds and at the peak of my gymnastics career,” she said. “So it felt like no big deal then.”

Ricardo, who turns 28 this month, reached level nine in gymnastics, where 10 is the most elite group. She decided at age 15 that she’d rather spend the extra 25 hours a week with friends at school, but the skills she developed in the sport come in handy for this show. 

“There’s a body awareness that you develop that other athletes don’t have because they’re not having to tumble across the floor and beam,” Ricardo said. “There’s a center of gravity and fearlessness that helps me with Peter Pan. But overall, it’s just the agility.”

Ricardo’s skills as a dancer were partly inherited from her parents, who danced on Broadway during the 1970s and ’80s in “42nd Street,” “Grease” and “A Chorus Line” and who met while appearing in Bob Fosse’s “Dancin’.”

But Ricardo has also learned from the likes of Andy Blankenbuehler, who won Tonys for choreographing “Hamilton,” “Bandstand” and “In the Heights.” She worked with him in 2011 on “Bring It On: The Musical,” which is loosely based on the film about competitive cheerleading. She also drew on her gymnastics background for that show.

“All the dancers and singers were tumbling,” Ricardo said. “There was a big learning curve for me to learn how to do it again, but it comes back to you. It’s insane what your body remembers.”

Ricardo left Emerson College to appear in “Bring It On” and said that her father is from Cambridge, so she is “very much fond of the Boston area.”

But this performance of “Peter Pan” is truly a homecoming for several members of the cast, including James Beaman, who is playing Captain Hook and Mr. Darling.

Beaman grew up in Beverly, where his mother ran a theater company called The Acting Place. He later got a degree in acting from Boston University and a master’s at the Shakespeare Theatre Company in Washington, D.C., before working as a cabaret performer in New York.

Beaman was previously at North Shore Music Theatre in “Guys and Dolls” in 2012 and “Spamalot” in 2016, after appearing in the national tour of that show.

Jake Ryan Flynn, who is playing John Darling in “Peter Pan,” is an 11-year-old Wenham resident who will be making his ninth appearance at North Shore Music Theatre with this performance.

“We had two days of rehearsal for flying,” he said. “You have to land in a certain way — keep your body up tight.”

Flynn said that he enjoyed performing with Paige Davis in “Mame,” the first musical this season at North Shore Music Theatre.

He is also still excited about the nine months he spent as one of three boys who played the lead in “Charlie and the Chocolate Factory” on Broadway, in a production that closed in January this year.

Flynn moved to New York for the role, and his parents and grandparents took turns staying with him in an apartment they rented.

“Rehearsals are much longer (on Broadway),” Flynn said. “Rehearsals were about three months.”

He sang six songs in “Charlie and the Chocolate Factory” and said that the theater had a proscenium stage, unlike the theater-in-the-round that he is accustomed to at North Shore Music Theatre. But otherwise, the audiences were about the same size as those in Beverly.

He’s looking forward to the novelty of wearing glasses in this show.

“I really like the story of ‘Peter Pan,’” Flynn said. “My favorite character is Captain Hook. I like the villains.”

If you go

What: “Peter Pan”

When: July 13, 14, 20 and 21 at 8 p.m.; July 14, 15, 18, 21 and 22 at 2 p.m.; and July 17, 18 and 19 at 7:30 p.m.

Where: North Shore Music Theatre, 62 Dunham Road, Beverly

How much: $59 to $84. Youths 18 and under save 50 percent at all performances. Children under 4 not permitted.

More information: 978-232-7200 or www.nsmt.org

FOR YOUNG AUDIENCES

North Shore Music Theatre is offering a series of children’s theater productions this summer for all ages. Each show lasts an hour and 15 minutes, which includes intermission. All seats are $12 at www.nsmt.org or 978-232-7200.

“Heidi,” today, 10 a.m. and 1 p.m. A charming Swiss miss captures the hearts of everyone she meets. Presented by Kaleidoscope Children’s Theatre.

“Hansel and Gretel,” Friday, July 20, 10 a.m. and 1 p.m. Two kids go for a walk in the woods and stumble upon a house made entirely of candy. Presented by Kaleidoscope Children’s Theatre.

The Airborne Comedians, Friday, Aug. 10, 10 a.m. and 1 p.m. Jugglers astonish as they throw and catch birdbaths, lawn chairs, electric guitars and baseball bats.

“Pinocchio,” Friday, Aug. 17, 10 a.m. and 1 p.m. A puppet who wants to become a real boy has a series of amazing adventures. Presented by Kaleidoscope Children’s Theatre.

Roald Dahl’s “Willy Wonka Jr.,” Friday, Aug. 24, 10 a.m. and 1 p.m. Charlie Bucket has a delicious time at Willy Wonka’s mysterious chocolate factory. Presented by NSMT’s summer program students.