getDefinitionByName Seemingly Not Working

Alright, weird issue here, out of nowhere basically. Trying to instantiate a class using a string, which works absolutely fine outside of one class (“NavButton”).


trace(NavButton.work); // traces MOTHER F***ING WORK!
classReference = getDefinitionByName("com.cfms.NavButton") as Class;
// returns ReferenceError: Error #1065: Variable NavButton is not defined.

I can manually instantiate the class through new NavButton(). It’s importing fine, it’s compiling fine, I can trace static vars fine, I can manually make the class. All of my other classes from the package work fine with getDefinitionByName…

PS. I’ve stripped everything from the class in case of conflicts, or something…


package com.cfms {
	import com.cfms.SiteSprite;
	class NavButton extends SiteSprite {
		public static var work:String = "MOTHER F***ING WORK!";
		function NavButton(xmlInfo:XML) {
			super(xmlInfo);		
		}
	}
}

ARGH! What am I missing here?