It took three years of her life and cost her a Malibu mansion, but Dyan Cannon accomplished her dream.

The dream was producing, writing directing and starring in "A Loss of Innocence," her first attempt at making a feature motion picture.A triumphant Cannon recently perched on a settee in a new home high atop the Hollywood Hills overlooking Los Angeles and explained her obsession with her movie, soon to be released to theaters.

There are elements of Cannon's life in the picture. Some characteristics of the men in the film bring to mind the males who were part of her world, including the late Cary Grant, her one-time husband.

The story deals with a woman crumbling under the pressures of a failed marriage. She tries to please friends and family at the cost of her own self-identity. She finally turns to drugs only to wind up in a rehab center where she recovers and begins life anew.

"My picture is about a woman's relationships with her parents and her lovers," she said. "It's not autobiographical, but there is a lot of me in it. There had to be. After all, I wrote the character and then played her.

"I've never been in a rehabilitation center, but I did do drugs, yes. Not the heavy stuff. Mostly marijuana and there was a man in my life who encouraged me to take LSD.

"The basis of my story is the fact that almost everybody is reared to make everyone else happy, no matter how they feel about what makes them happy."

What makes Cannon happy is filmmaking.

A decade or so ago she wrote, produced and directed a prize-winning short film about children titled "Dyan Cannon's Number One" and "since then I've had many offers from studios to direct and write other films, but they never wanted to give me enough time. This picture had been brewing in my mind for several years.

"I made hundreds of notes on the plot and characters before I began writing while I was in Florida for 10 weeks acting in a movie. When the script was finished I had a friend draw up a budget.

"The result was an estimated $1.3 million. I took it to an independent company and was turned down. So I decided to raise the money myself, which I did. The finished picture looks like it cost at least $10 million."

In truth, "A Loss of Innocence" cost $3 million, necessitating the sale of her Malibu house to finance its completion.

"Making this film was a struggle," she said, laughing. "They shut me down in the middle of production when we ran out of money.

"We completed shooting a year ago and for the past 12 months I've been editing and laying in the music and all kinds of things. I needed time to do it right.

"I was the first one on the set and the last to leave because I didn't have to pay me. We survived a Teamsters strike. Of course, there was the horror of the murder of Rebecca Schaeffer in the middle of it all. (Schaeffer played the lead character as a teenager). Terrible. Just terrible.

"Being a woman made it harder, but I couldn't have made it without the help of a lot of incredible men. My prayers helped too.

"I'm not through with the picture yet. I've got to go on tour with it in January to help get it publicized."