How is different flame color of alkali metals related to nuclear charge?

Why do different alkali metals produce different flame colors ?


According to my teacher,different atoms have different nuclear charge and due to difference in effective nuclear charge,the orbit to which an electron jumps differ even though energy provided from Bunsen flame is same.And on coming back it emits energy in the form of light.


This is very different from the reason I found when I googled my doubt. I wanted to know whether the explanation teacher me gave was correct. 


