How would I go about making stylized fire like in Kung Fu Panda 2?

Animate masks along a texture and do an overlap operation to create the final mask. It looks like several hard edged shapes being used to mask a flame shader.