The story is a satire of the film industry and Hollywood society. The main character, Felix Farmer (Richard Mulligan), is a phenomenally successful film producer who has just made the first major flop of his career, to the dismay of his movie studio, resulting in the loss of his own sanity. Felix attempts suicide four times: He attempts to die of carbon monoxide poisoning in his car, only to have it slip into gear and drive through the side of his garage, down a sand dune and into the Pacific Ocean. He then attempts to hang himself from a rafter in an upstairs bedroom, only to fall through the floor, landing on a poisonous Hollywood gossip columnist standing in the living room below. Subsequently, he tries to gas himself in his kitchen oven, but is prevented from carrying out his intent by two house guests with other things on their mind.
Thereafter he spends most of the time heavily sedated while his friends and hangers-on occupy his beach house. The occupation leads to a party which degenerates into an orgy. Finally, he tries to shoot himself with a police officer’s gun, but is prevented from doing so by the ministrations of a young woman wearing only a pair of panties. The experience gives him a brainstorm that the reason for his film’s failure was its lack of sex.
Felix resolves to save both the film and his reputation. With great difficulty he persuades the studio and his wife Sally Miles (Julie Andrews), an Oscar-winning movie star with a squeaky-clean image, to allow him to revise the film into a soft-core pornographic musical in which she must appear topless. He liquidates most of his wealth to buy the existing footage and to finance further production. If he fails, both he and Sally will be impoverished, at least by Hollywood standards.
At first the studio’s executives are keen to unload the film onto Felix and move on, but when Sally goes through with the topless scene and the film seems a likely success, they plot to regain control. Using California’s community property laws, they get the distribution and final-cut rights by persuading Sally to sign them over. An angry and deranged Felix tries to steal the movie negatives from the studio’s color lab vault, armed only with a water pistol. He is shot and killed by police who think the gun is real.
Felix’s untimely death creates a crisis for his cronies Culley (William Holden), the director of Night Wind; Coogan (Robert Webber), Sally’s press agent; and Dr. Finegarten (Robert Preston), who plan to give him a burial at sea. They steal his corpse from the funeral home, substituting the body of a well-known but underrated character actor who died in the first scene of the movie. Felix gets a Viking funeral in a burning dinghy, while the other actor finally gets the Hollywood sendoff many thought he deserved.
The epilogue later reveals that Felix’s revamped film was a box office smash, and Sally won another Academy Award for her performance.