5 Replies Latest reply on Jun 24, 2007 8:58 PM by SymTsb

    Strange error - HELP! : temp.as - Error #1046

    Nico22_be
      Hi all,

      I am converting a project to AS3. However I get a stranger error :

      **Error** ...\temp.as : Line 1, Column 210 : [Compiler] Error #1046: Type was not found or was not a compile-time constant: List.
      



      The strange thing is that THERE IS NO FILE NAMED temps.as. I've searched everywhere. I know that I did not create any, so maybe Flash 9 does it. Anyone has got an idea about that?

      Another strange thing is that after the error, instead of writing the code responsible for it, there is this 'À' which is actually followed by a square. I m a bit confused.

      Please help, thanks
        • 1. Re: Strange error - HELP! : temp.as - Error #1046
          Nico22_be Level 1
          Another strange behavior related to that temp.as file. Since there is no such file, I decided to create one like this :

          package {
          class temp {}
          }

          And to test. I then get new errors :

          **Error** \temp.as : Line 2, Column 8 : [Compiler] Error #1131: Classes must not be nested.
          class temp {}
          **Error** \temp.as : Line 1, Column 1 : [Compiler] Error #1153: A constructor can only be declared public.
          package {


          Very strange. But the strangest thing happens AFTER I compile. Indeed, after seeing those new mistakes, I tried to modifiy temp.as a bit more, but then, when I want to save the file, I get this message :

          "A sharing violation occurred while accessing \temp.as"

          !!! And so now I have to modifiy temp.as outside Flash! All other files can be modified normally. Weird.
          • 3. Re: Strange error - HELP! : temp.as - Error #1046
            pajaroplus Level 1
            Are you using the Alpha version of flash 9? Because since it is in alpha state things like this can happen.
            • 4. Re: Strange error - HELP! : temp.as - Error #1046
              RandyHowk
              I am running into the same problem. I was using the Flash9 IDE and I wanted a MC with some simple buttons to show up everytime I rotated my PPV3D shape around, so I put the mc on the stage and set the Flash to automatically declare stage instances. Everything compiled fine until I threw some other buttons up on the stage so I could swap them in and out of the mc to replace the other buttons. Then I started to get this:

              temp.as Line1 1046: Type was not found or was not a compile-time constant: interactive_btn.


              for all of the buttons. The thing is there is no temp.as anywhere on my machine so I assume it is the .as file Flash 9 makes for stage instances until it actually names the .as file. I tried reversing out but no go, the error persists even though I have turned off the automatically declare stage instances option in the publish settings. Has anyone else encountered this? And if so how do you get out of it? Google only shows one guy with this problem and no one helped him. The only thing I can think of is to take my code on over Flex 2 and either pull the instances from a compiled swf or just create them in Flex 2. Aaargh! I was just about at the end too!

              Thanks!

              Randy Howk
              • 5. Re: Strange error - HELP! : temp.as - Error #1046
                SymTsb Level 2
                quote:

                Originally posted by: Nico22_be
                Another strange behavior related to that temp.as file. Since there is no such file, I decided to create one like this :

                package {
                class temp {}
                }

                And to test. I then get new errors :

                **Error** \temp.as : Line 2, Column 8 : [Compiler] Error #1131: Classes must not be nested.
                class temp {}
                **Error** \temp.as : Line 1, Column 1 : [Compiler] Error #1153: A constructor can only be declared public.
                package {




                When declaring a package, you must give the path to the package

                package com.mysite.utilities {

                When Flash compiles, I believe it already creates a package{ line but who knows for sure until Adobe says so. As a result, you cannot next base level packages which is what the error is for.

                The second error is because of your class declaration.... it's missing a constructor

                package {
                class temp {}
                }

                should be

                package com.mysite.tempstuff {
                class temp{
                public function temp() {
                }
                }
                }

                Every class must have a "public" constructor to initialize it when it is called with the "new" flag.

                temp.as - this is probably an issue where Flash cannot create the temporary as file that it loads into the debugger when it runs in the dev environment.