18 Replies Latest reply on Oct 26, 2008 7:29 PM by apgoluc38

    Document Class Problem

    JoeLongstreet Level 1
      I'm working out of Colin Moock's Essential ActionScript 3.0 and I get this message when I try to save my file: "A definition for the document class could not be found in the classpath, so one will be automatically generated in the SWF file upon export." The document class is set to zoo.VirtualZoo

      My .fla file sits on the desktop. Also on the desktop, there is a folder named zoo. Within this folder named zoo there are several .as files, one of the is named VirtualZoo.as

      Even when I try to run the completed file that he provides I get this same message. I'm running MacOS10.4.11, using Flash CS3, and have already reset all of my ActionScript settings within my preferences.

      Here's the link to the files: http://moock.org/eas3/examples/moock_eas3_examples/virtualzoo_Flash_authoring/

      Any help would be much appreciated,

      Joe
        • 1. Re: Document Class Problem
          Damon Edwards Level 3
          Hey Joe, you might want to check your class paths for that document, and under your preferences. It's supposed to check in the same directory as your swf no matter what, but who knows.
          • 2. Re: Document Class Problem
            JoeLongstreet Level 1
            Yeah, I added a class path to my library but no dice. Same error. Should I reinstall flash? Would that help anything?
            • 3. Re: Document Class Problem
              Damon Edwards Level 3
              I dont think you should have to go to those lengths. My class paths are at the default and it works for me, possibly its only looking in the path you've added. Under preferences menu, ActionScript, ActionScript 3 settings, what shows? Under publish settings, flash tab, settings (next to flash version), what does it say?
              • 4. Re: Document Class Problem
                JoeLongstreet Level 1
                In my ActionScript 3.0 settings I have the default class path: Macintosh HD:Applications:Adobe Flash CS3:Configuration:ActionScript 3.0:Classes

                In my publish settings the document class is set to zoo.VirtualZoo and there is nothing listed in the bigger classpath window at the bottom. I tried to but in this one Macintosh HD:Applications:Adobe Flash CS3:Configuration:ActionScript 3.0:Classes, but it made no difference.

                Thanks for all your help,

                Joe
                • 5. Re: Document Class Problem
                  Damon Edwards Level 3
                  Thats extremely odd. You're all set to default. That zip file I linked to in your other post didn't work? It worked for me so thats really mind boggling. What errors are you getting exactly?
                  • 6. Re: Document Class Problem
                    JoeLongstreet Level 1
                    Yes very odd, I swear I have a legal copy and everything. The zip file didn't work on my machine. I emailed the link to my dad, who share the software with, and it ran perfectly fine on his computer. Anytime I try to save the file, or click on the pencil icon next to the class changer thingy, I get the same error: ""A definition for the document class could not be found in the classpath, so one will be automatically generated in the SWF file upon export."

                    Joe
                    • 7. Document Class Problem
                      Damon Edwards Level 3
                      I'm totally stumped. I hate to say this, cause I don't know if it is the solution or not, but I guess try reinstalling.........
                      • 8. Re: Document Class Problem
                        christophermonnier
                        I was having this same problem, too, and it had me totally stumped. It turns out that my problem was that I was specifying the class as "<classname>.as" (the filename with the file extension). However, on this page (search (Ctrl+F) for "classpath"), I found that "you don't choose a specific .as file....rather, you specify a fully-qualified class name." So I tried entering the class name without the ".as" and it worked! Note that I still got a dialog box when I click on the green checkmark, but this time it said that the file was found.

                        I hope this helps!
                        • 9. Re: Document Class Problem
                          bend
                          I had the same problem and while I don't know why it happens, I found a workaround that worked for me.

                          1. Go to Preferences > ActionScript > Actionscript 3.0 Settings and add the desired path to the global classpath.
                          2. Open your FLA, go to the Publish Settings and click the checkmark by your base class. It should be found.
                          3. Now add the desired path to your FLA classpath. Click the checkmark again and it should be found.
                          4. Go back to the global classpath in the Preferences window and remove the path.
                          5. Go back to to your FLA Publish Settings and click the checkmark. It should be found.

                          Not sure if this will work for you, but it's worth a try!
                          • 10. Re: Document Class Problem
                            finnsquib
                            Im also having this problem. I noticed that if I took out the zoo package name from all the classes and then just set the document class to VirtualZoo (not zoo.VirtualZoo) the program works fine. Annoying though, as I want to get to grips with using my own custom packages. Is there any other way to figure this out that doesnt involve the work around?
                            If it makes any difference Im using the mac version of flash CS3.

                            Please can someone find out whats going on here.
                            Thanks.
                            • 11. Re: Document Class Problem
                              JoeLongstreet Level 1
                              Hey, I tried everything to get Flash working correctly but it was no use. The only solution I could come up with was to reinstall Flash. That worked, don't have any idea why though.

                              Joe
                              • 12. Re: Document Class Problem
                                finnsquib Level 1
                                Just reinstalled. It worked for me. Yay. This is weird.
                                • 13. Document Class Problem
                                  finnsquib Level 1
                                  Thanks you guys.
                                  • 14. Re: Document Class Problem
                                    jmark0
                                    I am also having a problem trying to get the same moock files to work:

                                    http://moock.org/eas3/examples/moock_eas3_examples/virtualzoo_Flash_authoring/

                                    I am using XP and CS3 and downloaded these files and set them up as instructed.

                                    I set the flash file up in a directory called 'src' and the .as files under that in 'zoo'

                                    I was getting the same error ("A definition for the document class could not be found in the classpath, so one will be automatically generated in the SWF file upon export.") where the flash document could not find the document class, even when I put in the target in the classpath under ActionScript 3.0 Settings under Publish Settings. I reinstalled flash and added the path to the file's actionscript 3.0 classpath settings using the target button.

                                    I tried putting the document in the "Document Class" box in the Properties tab, but I got the same error.
                                    Then, I went to Publish Settings, Actionscript 3.0 settings, and added the path with the target button. I again put VirtualZoo in the Document class box and used the checkmark and got a dialog that says it found the file. Using the pencil gets me to the VirtualZoo.as file.

                                    However, when I try to export it, I'm now getting the error 'The name of package 'zoo' does not reflect the location of this file. Please change the package definition's name inside this file, or move the file. I get this error for all the .as files in the 'zoo' folder, which are all part of the package 'zoo'.

                                    Am I missing something here?
                                    • 15. Re: Document Class Problem
                                      JoeLongstreet Level 1
                                      I reported this error to adobe but they just sent me a document about the purpose of a document class, no help at all. I would recommend just reinstalling, that worked for me.
                                      • 16. Re: Document Class Problem
                                        jmark0 Level 1
                                        That is unfortunate, because I already reinstalled flash.
                                        • 18. Re: Document Class Problem
                                          apgoluc38 Level 1
                                          I ran into the same problem when compiling Moock's VirtualZoo program and I tried everything from reinstalling Mac version Flash CS3 to SVN export the root files as suggested by some on-line flash forums...with little and no success.

                                          However, I tried the suggestion posted by "finnsquib" - by taking out the zoo package name from all the classes and then just set the document class to VirtualZoo (not zoo.VirtualZoo) - the program WORKS!!!

                                          thanks "finnsquib".