I built an interactive town map, which ran great until I got an error code "5005: Unknown error optimizing byte code. I was told to increase my Adobe memory (.ini) file. Well the file runs now, but when I add something new from the library to the stage, I get the following code and I don't know why? I get one of these for every image on the stage, and it just keeps looping. No matter what image I add, I get this code, but when I remove the image, the project runs great.

Typically you get '5005: Unknown error optimizing byte code' message in Flash-based applications made up of thousands of lines of code, numerous large objects, or a great number of small classes. You can fix this by increasing the Java VM memory which I think you have already done. The ReferenceError: Error #1065 occurs when you do not declare your class as public. Private classes can not be used as document classes because they are out of the class package and therefore are not a part of the private scope. Try this out and see if it helps.