NOW SHOWING

“The Amazing Spider-Man 2”

Starring Andrew Garfield, Emma Stone, Jamie Foxx, Sally Field, Dane DeHaan and Paul Giamatti. Directed by Marc Webb.

Rated PG-13 for sequences of sci-fi action / violence. Check listings for theaters. 2 hours, 20 minutes.

He’s got a range that extends from cross-dressing tomfoolery on TV’s “In Living Color” to gridiron drama in “Any Given Sunday,” masterful musicianship as Ray Charles in “Ray,” and blaxploitation heroism as a vengeful ex-slave in “Django Unchained.” But Jamie Foxx has never had a role as extreme as the angry aggregation of electrons he plays in “The Amazing Spider-Man 2.”

As the high-voltage villain Electro, Foxx terrorizes New York City as he flings lightning bolts at co-star Andrew Garfield. Digital effects add a kind of bioluminescent static electricity sparking beneath the character’s glowing ice-blue skin.

Spidey’s iconic nemesis isn’t all bad, however. In a phone conversation, Foxx said one of the attractions of the film was that it adds a sympathetic back story to the menace, who begins as a downtrodden engineer.

“We really homed in on the personal story of Max Dillon,” an Osborne Corp. lackey first seen with nerd glasses and an oily comb-over. There’s comic pathos in the way the character is betrayed in family, work and love, pushing him to lash out at the world, Foxx said.

“What’s interesting in the Spider-Man comic books is that they don’t start out bad. They start out with good intentions, but it seems like the world deals them the wrong cards. It’s the same with Peter Parker,” a nice high school kid who takes the weight of the world on his shoulders after a radioactive spider bite. “Then they get to that crossroads of being powerful for good or powerful for bad.”

Foxx, born Eric Bishop, grew up in Terrell, Texas, on a cultural diet of “comic books, cartoons and ‘The Electric Company,’” the PBS children’s show where the web-slinger appeared in nonsensical skits. “Spider-Man was interesting ‘cause he was a high school kid, while Batman was older,” Foxx said. “And Spider-Man was easier to do because he didn’t have a cape. You could just run around and shoot your webs.”

As a kid, Foxx acted out sketches in the mirror and studied piano. By his teens he was in demand to play for the country club set. He studied music at college in San Diego, but got sidetracked into comedy when he took the stage at a stand-up club’s amateur night. He joined the cast of Keenen Ivory Wayans’ multicultural sketch show “In Living Color” from 1991 to 1994.

He quickly climbed the Hollywood ladder. In 2005 he was Oscar-nominated both for his supporting turn in the Tom Cruise thriller “Collateral” and his lead performance in “Ray,” winning in that category. He’s a double Grammy winner, as well, for performances with Kanye West and T-Pain.

Appearing in the Spider-Man sequel had its attraction for both Foxx and the producers, he said. They could use his presence to draw viewers who enjoy his work but haven’t hooked into the “Spider-Man” story line. And Foxx, 46, could use the franchise, which he calls “popcorn-friendly,” to reach younger viewers.

“Kids will really respond to it because it’s really up their alley. It’s very jokey. It’s back to the childlike Spider-Man, where it’s a lot of fun. It seems to be working in our favor.”

The film opened well internationally two weeks ahead of its U.S. debut. The series has developed a case of superhero fatigue domestically, however. In the United States, each “Spider-Man” movie has earned less than its predecessor.

Entering the rebooted franchise in its second installment had advantages and drawbacks, Foxx said. “When there’s a family already there, you want to get along with the family. At the same time you want to enhance the film as much as you can, bring as much flavor and information to the character as you can. When I’m doing Max, it’s like going back to my ‘In Living Color’ days, being over-the-top. Then it lets me go into Electro, which isn’t Django, but it’s more serious. They may not be able to use all of it, but you want to be a good family member.”

Shooting the effects-heavy film last year was a return to his days as “a kid doing your acting in front of a mirror,” he said. Acting against green screens and reacting to images that would be inserted later “uses the same muscle. It gave me a lot of freedom, actually. Me being a stand-up comedian, I’ve always been used to creating another character onstage. It really plays to my strength.”

As for Electro, Foxx says that we probably haven’t seen the last of him.

“This movie is just the genesis, the beginning of what Electro can be,” he said. “They’re talking about (making a sequel with) the Sinister Six,” a league of supervillains united against Spider-Man, which might return Electro to the screen.

“Electricity never dies,” Foxx said. “It just goes to a different place.”