In addition to Michael Keaton and Jack Nicholson's performances as Batman and the Joker, respectively, one of the most memorable aspects of director Tim Burton's 1989 Batman film is Danny Elfman's iconic score. According to Elfman, however, the inspiration for Batman's music hit him at the "worst possible time" -- while he was on an airplane. And his subsequent behavior apparently raised some concern among the flight attendants.

During a recent appearance on the WTF with Marc Maron podcast (transcribed by The Hollywood Reporter), Elfman explained that while Batman was in production, he had flown out to London in order to visit the film's set and, hopefully, get some inspiration. That inspiration did come, albeit while Elfman was on his return flight to Los Angeles. "That hit me at the worst possible time," the Oingo Boingo alum explained. "On the way home, the thing fucking hits me. And it was like, what do I do? I'm on a 747. How do I do this? I am going to forget this all. I'm going to land and they're going to play some fucking Beatles song, and I'm going to forget everything."

RELATED: Batman '89 Artist Joe Quinones Teases Michael Keaton's Unused Batsuit

Fortunately, Elfman had a recorder that he brought with him everywhere. However, he had to go to the airplane's restroom in order to use it, which he did multiple times in quick succession. "I start running in the bathroom [and hum phrases] and I go back to my seat, and I'm thinking, I'm thinking. Ten minutes later, back in the bathroom," Elfman said. "And then back to my seat and then back to the bathroom, because I couldn't do this with the guy sitting next to me."

The composer's repeated trips to the lavatory ultimately resulted in him being confronted by suspicious flight attendants. Elfman apparently assured the them that there was nothing wrong, though they didn't seem particularly convinced. "Ten minutes later, I am back in the bathroom, And I open the door and this time there are three flight attendants," he recalled. "And they were probably going, 'What the fuck he is doing so frequently? You can't do that much blow. You can't shoot up that often. What is he doing in there?!' And I piece by piece was working out the Batman score in my head."

RELATED: Jerry Ordway Batman '89 Variant Debuts Billy Dee Williams' Two-Face

Interestingly enough, Elfman recently confessed during an appearance on the Premier Guitar podcast that while he was "reasonably happy" with how his Batman score turned out, he was unhappy with how it ended up being used in the film. "They did it in the old-school way where you do the score and turn it into the 'professionals' who turn the nobs and dub it in," he explained. "And dubbing had gotten really wonky in those years. We recorded [multi-channel recording on] three channels -- right, center, left, -- and basically, they took the center channel out of the music completely."

Elfman is certainly no stranger to scoring comic book films. Following Batman, he went on to compose the music for Batman Returns, Spider-Man, Spider-Man 2, the theatrical cut of Justice League and all four Men in Black movies. Elfman recently reunited with Spider-Man director Sam Raimi in order to score his upcoming Marvel Studios film Doctor Strange in the Multiverse of Madness, which is slated for release next year.

KEEP READING: Cutting Doctor Strange From WandaVision Makes His Sequel Better, Says Kevin Feige

Source: WTF with Marc Maron, via The Hollywood Reporter