"Agent Cody Banks" is an entertaining film for kids and young teens. It's also a product of the era in which we're living, and weird times make for weird movies.

It's a romance about two prep school kids in their early teens, a jolly frolic set against a background of world terrorism. Cody Banks (Frankie Muniz of TV's "Malcolm in the Middle") is both an awkward kid who freezes up whenever he talks to girls and a junior CIA agent charged with protecting the entire military arsenal of the United States from terrorist agents. Throughout the movie, everybody is smiling and happy -- but why?

So "Agent Cody Banks" is both enjoyable and unintentionally creepy. Take, for example, the scene in which our young hero is called up to active duty and brought to CIA headquarters. Without any of the healthy irony that usually characterizes the American attitude toward authority, Cody is told, "You will speak only when spoken to. You will follow orders without question." This, in a comedy.

The scene is reminiscent of the kind of thing once seen in Stalinist musicals, in which people merrily sang and danced about the glories of tractors, factory work and the latest five-year plan. We might expect that from a totalitarian society, but when a U.S. film, directed at kids, starts assuring us that it's possible to simultaneously have a boot in your face and a smile on your face, it's at least worth noticing.

Cody is transferred to a new prep school and assigned to get close, very close, to the prettiest and most popular girl in the school, Natalie (Hilary Duff). Her father (Martin Donovan) is a scientist, and the government needs to know about the work he's doing for some shady international characters.

In a story sense, the premise is nonsensical because the government already knows all it needs to know. But in a psychological sense, the premise is perfect. Every 15-year-old boy believes that if he can't get the girl of his dreams, the world will come to an end. In "Agent Cody Banks," the boy just happens to be right. The prospect of geopolitical calamity lends an extra edge of urgency to the boy-meets-girl stuff.

What bad luck. The agent is a nerd, and the scientist's daughter just happens to be beautiful. This is where "Agent Cody Banks" is at its best and funniest. With the help of a cadre of secret agents, Cody keeps trying to worm his way into Natalie's esteem, while she remains put off and mystified by this stammering stranger.

So long as it focuses on the personal, the picture remains amusing, but in the last third, it's as if someone remembered the box office success of the "Spy Kids" movies. The movie stops relying on the comic abilities of its engaging young co-stars and gets bogged down in gadgetry. The pace is drawn out. We start seeing bad processed shots of things like Cody skiing on a jet- propelled snowboard, and all novelty and momentum are lost.

Still, "Agent Cody Banks" is never bad, just odd, and may it remain ever so.

Indeed, that's what's especially unsettling about the film, watching without knowing whether the movie is a manifestation of some temporary societal neurosis or something future audiences will consider normal.