The actress is best known for her role as Max in the Suite Life of Zack and Cody and as Sarah in Cheaper by the Dozen.

Alyson Stoner has come out as bisexual, after penning an essay in Teen Vogue, where she opened up about embracing her sexuality. Stoner also explains how the girl that she fell for is one of the main influences for her latest song, When It’s Right.

“My lyrics and melodies before I met her feel light-years away because of her profound effect on me. My new single “When It’s Right” is the first painting of a vivid new world I now call home, and she’s the main inspiration,” she writes.

She explains how her friend brought her to a dance workshop to work on her choreography, and how she became “mesmerized and intimidated” by the instructor.

Stoner went on to write how following the class she texted her mother and best friend saying: “I met a woman today, I’m not sure who she is or what I’m feeling, but I think she’s going to be in my life for a very long time.”

Stoner then explains how her friendship with the dance instructor progressed, but that she realised that there was perhaps something more to it. She wrote: “Our bond didn’t feel quite sisterly or platonic.

“Flashes of her smile progressed to flashes of her wavy hair followed by the curve of her hips through her straight-leg pants. I realized I had never fantasized about a guy this way, nor really ever felt comfortable dating guys.”

Related: DJ and producer Felix Jaehn comes out as bisexual

However, Stoner quickly dismissed romantic feelings, thinking instead it was societal conditioning to stare at the bodies of women. But then, their relationship progressed over an episode of Orange is the New Black.

“She and I continued to hang out and began sending good morning texts. Then we made dinner and watched Orange Is the New Black. Then we vented and supported each other. Then cuddled. Then kissed and kissed some more. OK, we were in a relationship. I fell in love with a woman,” she wrote.

But Stoner admits that following this, she was scared, and spent years trying to “identify the source of my attraction to her.” She initially thought that she’d had these feelings because she’d moved away from her father at a young age.

Stoner then goes on to write about how her faith impacted her at this time as well, and admitted that her “worldview neither supported nor accepted same-sex relationships.”

She went on to say that she went through conversion therapy to try and get rid of her feelings. “I prayed in turmoil nightly, begging to be healed from these desires. Certain pastors and community members tried to reverse and eliminate my attraction to her.

“I pursued physical relationships with men to convince myself that my love for her was just a spiritual battle attacking my character and discernment.

“I pored over texts, contemporary and ancient, seeking truth and answers from professors, scientists, church leaders, friends, and family.

“I didn’t want to get this wrong. After all, not only was I trying to be a “good and upright” person, but I’m also a public figure with responsibility and extreme pressure,” she wrote.

Alyson explains how she went through this until one day she collapsed on her bed. She goes to write that after telling God that “if I’m evil, then I accept this and give up,” she felt “a transformation, an ascension, an approach to life rooted in real love.”

She then comes to terms with her bisexuality, writing: “I, Alyson, am attracted to men, women, and people who identify in other ways. I can love people of every gender identity and expression.

Related: Star Jones’ ex-husband Al Reynolds comes out as bisexual

“It is the soul that captivates me. It is the love we can build and the goodness we can contribute to the world by supporting each other’s best journeys.”

She finishes her essay with an empowering message for the LGBTQ community, writing: “If you’re questioning or struggling with your sexuality, gender identity, or anything else, know that I and so many who’ve gone before us are with you. Whatever your identity, you are lovable and wonderful and enough.

“I’m on the other side of some of these battles internally, but it’s still a challenge in the outside world. It’s OK. Dare to be yourself anyway. Find support, because we’re out there!

“And when you fall in love with anyone, you’ll know exactly what I felt for her. As “When It’s Right” describes, it’s right when it’s right — and who it’s right with. She messed up everything in the best way possible, and I wouldn’t change a thing.”