Richard Linklater admitted Thursday night that his much-lauded “Boyhood” came to be only after he had entirely given up on the idea of a movie encompassing a boy’s childhood.

“My ideas were all over the place,” he said in an appearance at the Los Angeles County Museum of Art’s “An Evening with Richard Linklater,” sponsored by Film Independent.

The writer-director, who already had “Dazed and Confused” and “Before Sunrise” under his belt at that point, recalled in a conversation with Film Independent programmer Elvis Mitchell that back in 2002, he was baffled as far as how to approach the “Boyhood” narrative structure — so much so, that he was instead embarking on writing a novel.

“I just didn’t ‘have’ the film, and I had pretty much given up on it,” Linklater said. “And just as my fingers hit the keyboard, the whole film popped into my head — proving that I’m not a novelist, I’m a filmmaker.”

The film was shot over a twelve-year period from May 2002, to October 2013 — usually in shoots of two or three days each year.

“Finding the way to tell it was the big idea,” he noted, of his eventual epiphany. After that, his vision was clear: “I knew the last shot of the movie from the second year.”

Linklater noted that the only comparable project to “Boyhood” is Michael Apted’s “7 Up” documentary series, that’s followed 14 Britishers since 1964, with a new chapter every seven years. “A monumental cinematic achievement” was how Linklater described the series.

The evening featured clips from “School of Rock,” “Waking Life,” the “Before Sunrise” trilogy and cult hit “Dazed and Confused” — including a key scene in which Matthew McConaughey’s character, David Wooderson, met Cynthia Dunn, Marissa Ribisi’s character, planting seeds of both McConaughey and Linklater’s impending stardom.

(Pictured: Richard Linklater and Elvis Mitchell at the LACMA presentation.)