Renowned film composer, former Oingo Boingo frontman, and frequent Tim Burton collaborator Danny Elfman recently launched his in-depth MasterClass aptly titled Making Music Out of Chaos, a fascinating must-see for anyone pursuing a career in cinematic music-making. However, there’s one life lesson that Elfman says he’s wary of sharing with his impressionable students, when he discusses what he considers to be “the single biggest, most stressful gamble” of his career.

“This is the tricky area when it gets down to talking to students, because I took a great gamble with Batman that I wouldn't necessarily recommend to a student that I'm talking to do the same,” Elfman tells Yahoo Entertainment, referring to his landmark film score that turns 30 this year. “Which is, I was willing to walk away from the film, rather than compromise what I knew should be the sound of the film. And I had to actually [walk away] for a short period of time.

“There was a period where the producers wanted me to co-write a score with Prince, and I just wasn't willing to do it. I knew what the score was, and as much as I love Prince's music, I didn't feel that his score was going to be the right score sound for the Batman movie. And so, I had to walk away and let that play out, and then got invited back in again.”

Elfman confesses that he “did go through a period of time where I just felt like I'd walked away from the greatest opportunity of my life due to my own stubbornness,” even though “it ended up coming back around and becoming something that helped really define who I was. But it was a gamble that I wouldn't advise young composers easily. … You never want to encourage somebody to hold out for something that ruins their career. But at that moment, I was willing to ruin my career. It's like I had a great luxury that many composers don't have, which was a ‘f***it’ attitude towards everything. And I still felt at that point, ‘If they don't like it, f*** it.’ And it just came out of my post-punk upbringing, but it's not an attitude that I think is necessarily a healthy one for people to take into their careers. It's just that worked to my advantage.”

Batman, directed by Burton, was the first truly massive film production that Elfman had ever worked on, and it was an entirely different experience from films like Burton’s Pee-wee’s Big Adventure and Beetlejuice. “Essentially, when a movie is below a certain budget, it flies under the radar of all the heavy concern of a studio. Batman was not at all like that,” Elfman chuckles.

“And I’d never worked on a film that wasn't a comedy — and quirky comedy, at that. That was why there was so much resistance. I don't think the producer or the studio wanted me on the film. They were like, ‘This maybe isn't Danny's ballpark, the quirky comedy guy.’ I understood it, but it was just like a real struggle, because there was a lot of different directions of where the music should go.”

Elfman reveals that at one time, there was an “early, early version of Prince and Michael Jackson and George Michael — and we would share the score, and I would just kind of be the coordinator. These were the early musings of the producer, Jon Peters, who was really difficult. Selling Jon on the score was an incredibly difficult thing. But I have to say that once he was sold, he was a real champion of the score, and he became a great ally. But it was just really, really tough to turn him in that direction.”

Elfman admits that everybody thought he was “crazy” to turn down a chance to work with Prince, but he says, “I had to stick to my guns. … My feeling at that point was that Prince was a great, great songwriter, but that he probably was not a film composer, and that he would come up with melodies, and I would essentially be turning those melodies into a score. And so, my feeling is that I would end up being a glorified orchestrator, or an arranger, not a composer on the project. And I just wasn't willing to do that.”

Elfman stresses that he “would have really loved to work with Prince in a different scenario. … If there was a different kind of film, a weird contemporary film with a twisted soundtrack and I could have collaborate with Prince — like, ‘You do the funky-feel stuff, and I'll do the weird orchestra stuff, and we'll find a medium between’ — it would've been great. I would have loved that opportunity. But at that moment, I felt that Batman wasn't it. I already knew in my head exactly the score that I knew would serve the film. And like I said, I was young and impetuous, and I took a gamble.”