It was a year and a half ago when Norman Lear had his idea. "I hope we can take back the flag," he remarked at the end of a New York board meeting of People for the American Way, which Lear helped form out of the tensions of the 1980 political year to counter the growing power of such single-issue groups as the Moral Majority.

When they asked Lear what he meant, the television impresario who brought Archie Bunker and other archetypical American characters into our living rooms, replied:

"Americans love symbols of liberty and patriotism--that flag. We never gave it up, but never publicly or deliberately held on to it, and so a narrow group on the far right have claimed it as their very own. And they behave in a way that indicates perhaps the rest of us don't even care about it.

"It's time not just to show we care for it. It's time to show all those who are feeling the same thing to understand they are great in numbers and to raise up a lightning rod around which to collect all their patriotic energy. And I mean patriotic in the most common, ordinary term. So, if everything goes all right tonight, I think you will find America has taken back that flag unto itself."

Tonight, after the expenditure of months of effort, nearly $3 million and the recruitment of a Hollywood producer's dream of big-name talent, Lear's idea takes final form. Some right-wing groups are already angry and see Lear's production as liberal propaganda aimed at discrediting them, but Lear brushes aside the criticism.

Here, in the cavernous Los Angeles Sports Arena, an audience of some 12,000 people, chosen from throughout this metropolitan area as a representative cast of the American people, will witness about three hours of taping of a gaudy, unabashed celebration of American patriotism.

As one might expect here in lotus land, where each spectacular always is topped by another more stupendous one, tonight's performance has everything, and more: stars and bands and songs and Uncle Sam characters and unicyclists and dramatic readings and renditions of scenes from America's historical past.

The final edited product will be telecast in prime time by ABC March 21 with commercial sponsors that Lear hopes will help defray the huge cost of the production.

Politically, it may contain something more significant.

Tonight's production of Lear's "I Love Liberty" brings together people representing such sharply differing poles of political thought as Jane Fonda, Sen. Barry Goldwater and Burt Lancaster. Lending their names as honorary sponsors are former president Ford, Lady Bird Johnson and Walter Cronkite.

Even the late John Wayne will be included--in a filmed interview in which he discusses his political differences with Jane Fonda, but defends her right to disagree.

Lear and his scriptwriters have consciously excluded any references to the right or the Moral Majority by name, but their implicit message is that patriotism encompasses much more than any single idea. It is the political diversity of America, past and present, the range of competing ideas, which Lear and his associates are celebrating.

The message is part history lesson, part mass entertainment, part exposition of political sentiment. Interspersed with the gospel singers and chorus line routines are segments dealing with grimmer aspects of American life. Angry blacks and Hispanics are portrayed. So are a gay man (played by Rod Steiger) and a woman who feels discriminated against because of her sex.

The show reaches in and out of past and present with scenes from the Continental Congress (done by the Muppets), and a speech from the great liberal jurist Learned Hand (Lancaster), who says he cannot define the spirit of liberty but believes it to be "the spirit which is not too sure it is right."

A rousing George M. Cohan number (sung and danced by a black, Gregory Hines, and introduced by Goldwater) comes along with a scene showing an old Jewish immigrant who rouses the rabble in the park with orations on his view of American life. It's more than government represssion that's dangerous, the immigrant declares. It's when people suppress ideas that real repression occurs. They do so out of fear, an implicit warning of Lear's show. The immigrant says:

"And fear gives birth to more fear and becomes like a fashion sweeping a nation like a new suit. The people, the people, so full of fear they forget their rights."

Not surprisingly, such a collection of political names and themes, coupled with Lear's own reputation as a liberal who has backed Democratic presidential aspirants, has aroused controversy.

As a successful producer of mass entertainment for television, Lear believes that the medium has unrealized potential for delivering political ideas and forming political values. That kind of approach has its perils. As the recent government-sponsored TV program, "Let Poland Be Poland," demonstrated, merely assembling a large collection of Hollywood stars does not necessarily deliver a convincing political message.

The Rev. Jerry Falwell, head of the Moral Majority, wired Lear asking he be invited to speak on tonight's program.

Falwell noted that since the program was being presented by People for the American Way, a group that came into being to counter his own work with the Moral Majority, it would be in the best interests of the American people to hear his views along with those of others. If invited, Falwell promised to bring along his Liberty Baptist Choir to sing a patriotic number.

Lear declined Falwell's request, saying the production was not intended as a forum for political speeches.

There also have been intimations that the Moral Majority might ask the Federal Communications Commission to grant it equal time under the fairness doctrine governing TV political productions. ABC has come under criticism for agreeing to air the production.

Lear takes pains to point out that his production in no way criticizes any group. The reason he has been able to attract enthusiastically such a wide range of political types to the show, he says, is because they all share a common belief--in the need to praise America's diversity of political thought, to remind people of their common political traditions, and to praise the achievements the nation has made in its 204-year history. That definition of patriotism is what Lear seeks to engender with tonight's flag waving extravaganza.

"There's a character called the American and he expresses the essence of this show and I guess what I hope it will achieve," Lear said, sitting behind a battery of TV consoles looking out over the last-minute rehearsals before tonight's production.

"I don't want to sound presumptuous but I believe the country by and large is so turned off. People are feeling such helplessness and such a feeling that the individual doesn't matter.

"And there's a kind of cynicism in the press, the media, I feel, that feeds that hopelessness and feeling of helplessness. If we could get just a little bit of fresh understanding that, at the risk of being sentimental, in this most blessed of societies the individual still matters.

"And I think that, in this respect, the New Right proves this to be true every minute. There are not that many people involved in the New Right when you consider we have a population of 230 million. Yet because they are so passionate and are so active and are so involved, they show many individuals that they can matter in important ways. This was true of progressives in the '50s and '60s and that pendulum keeps swinging back and forth.

"We're not here to proselytize for a point of view--except in a society where the individual does matter, let's help him to understand he does. If we can fan the desire to get out there and matter, we will have accomplished something.

"I think we live in a time of win-or-lose mentality where if you don't win you're a total loser. It seems to me the notion my generation grew up with was that life had a lot more to do with the level of succeeding at your best. You had a ride on the carousel. It had one brass ring. Somebody would grab it but everybody else got to enjoy the ride.

"Now with my youngsters and others it seems as if life is about winning or losing and they pick up this bottom-line mentality that all of American business and enterprises and the media share . . . . I've talked to enough television news people to believe they don't think good news sells. They all live with the conviction that only bad news sells. So bad news is first."

Those words reflect Lear's personal concerns; he also has the traditional doubts of opening night.

"Three weeks ago I was convinced there would not be a show," he says. "I was praying that something would happen--some little attack of influenza or angina or anything, or even the network to say they didn't want to do it--that would get me out of this thing.

"It's only the last six or seven days that I've gotten really so excited about it. It is very susceptive to a catastrophe. Everybody's wearing what's known as an RF mike, remote feeds, all body mikes, and we're in an area where it's hard for people to hear. The mikes could go out, the cameras could go dead.

"But if the fates are with us and technically things go well, I just couldn't be more pleased."