Maggie Gyllenhaal was inspired to direct a movie after portraying a filmmaker on The Deuce.

The actress appears as Candy opposite James Franco in the HBO programme, which tells the story of the legalisation and ensuing rise of the porn industry in New York City in the early 1970s.

Part of the plot sees sex worker Candy begin to direct explicit films, and during an interview on The Tonight Show Starring Jimmy Fallon on Tuesday night (09Oct18), Maggie explained that the role influenced her decision to helm the upcoming screen adaption of Elena Ferrante's popular novel The Lost Daughter.

"I think I was in some ways inspired by Candy," she said. "To be totally honest with you, I'm not proud of this, but I don't know if I felt entitled to do it before. I've always been a lover of movies and I've always been a storyteller but I think I kind of thought I had to put it in my acting."

Maggie went on to explain that she decided to consider filmmaking when she discovered Elena's 2006 book. She wrote to the Italian author, who uses a pseudonym, and was pretty surprised when she received the rights to make the movie.

"It blew my mind," the 40-year-old insisted. "I asked her if I could have the rights to write and direct it and then I got scared, which I think is fair enough, and I said to the publishers, 'Hey, look can I have an out? What if we can't get the money with me directing it? What if I have to act in it?' And (the response) came back from her, 'No, I only want to give you the rights if you direct it.'"

Before Maggie begins work on her next movie, she is promoting The Kindergarten Teacher, a drama about a teacher in New York who becomes obsessed with a student who she believes is a child prodigy.