5 Replies Latest reply on Feb 16, 2010 6:57 AM by Ned Murphy

    How to read "Type Error: Error #1034: Type Coercion failed"

    Virinao

      Hi everyone,

      I have been getting the following Error in one of my projects:

       

      TypeError: Error #1034: Type Coercion failed: cannot convert hp8_Southerlys_fla::gallery_content_31@21f57221 to Array.

       

      since the code is rather long I do not want to bother you with it, instead I would like to figure it out myself. But for that I need to be able to read this part: gallery_content_31@21f57221

       

      gallery_content is one an instance that I created. But what does the "_31" mean directly after? at frame 31? Inside of gallery_content there is no frame 31... and what does the stuff mean after the @?

       

      Help would be greatly appreciated.

      And if nothing helps i might have to bother you with the code. I hope it wont come to that, though.

       

      thanks,

      Anhulha

        • 1. Re: How to read "Type Error: Error #1034: Type Coercion failed"
          Ned Murphy Adobe Community Professional & MVP

          Your best bet would be to ignore the numbers and concentrate on finding where you are treating whatever gallery_content is like it is an array.  That 31 might be a line number or a frame number but it could also be anything that the compiler might generate in detecting and reporting an error, just like the rest of those numbers in the mix.

           

          If you select the option to Permit debugging in the Flash Publish Settings, you may find some additional information in the error message that helps to point to the line of code that is causing the problem.

          • 2. Re: How to read "Type Error: Error #1034: Type Coercion failed"
            Virinao Level 1

            Hi Ned - we meet again

            Thank you for your quick response. Unfortunately permitting debugging didnt help me. It did not change the Error Message in the output window.

             

            Funny about my code is, that I used the exact same code in a different file for test-purposes. I tend to do that: have different single-effect fla's in order to test code that I do not want to implement in my main project just yet. In the test.fla all the code worked without flaw. and afaik all the mc's and external files are in the exact same place relative to the main project as they were, when i used the test-file. Since the code worked I am almost 100% sure that I cannot be an issue of the actionscript inside of the fla file.

            In the process I import an xml file... maybe it has something to do with that. Oh man, this is getting really demotivating.

            • 3. Re: How to read "Type Error: Error #1034: Type Coercion failed"
              Ned Murphy Adobe Community Professional & MVP

              The error message is indicating the problem.  Whatever that object is, at some point your code is treating it like it is an array in some way... possibly just a syntax issue where you use brackets incorrectly or something.  Unfortunately, if you cannot show the code relative to the error, it's not likely anyone can help.

              • 4. Re: How to read "Type Error: Error #1034: Type Coercion failed"
                Virinao Level 1

                Sure I can show u the code, i just think itll not show u anything since it worked in a different file.

                 

                Here goes:

                 

                http://paste-it.net/public/d562a03/


                EDIT: forget it, I found the problem! duplicate name. my mc had an instance name of gallery and so did an array that I used to make the buttons work. The link above shows only the code inside said mc, not the one outside on which i shouldve been focusing! it was trying to treat the gallery mc as an array which was my fault entirely.

                 

                thanks!