AS3 Variable not defined Reference error 1065

I keep getting this error for every single symbol that I have in the library that is linked to actionscript… I have searched everywhere for this and cannot find a solution that works for me! I have everything set up exactly how it should be in the AS Linkage properties and the weird thing is that **it works perfectly fine except in debug mode. **It only gives the error when I compile in debug mode or enable ‘permit debugging’ in publish settings. All the actionscript runs fine when I don’t use debug mode. All my classes are public so that is not the problem.

Does anyone know something that can cause this problem?