Model number variations: MDG8400
This is a classic bad timer condition; if the dryer runs in one cycle it should run in the rest. Replace the timer and problem solved!
Part link for the timer==> http://www.repairclinic.com/SSPartDetail.aspx?s=t-MDG8400AWW-%3d%3dc13i1002865&PartID=1002865
To learn more about your washing machine, or to order parts, click here.