19 Replies Latest reply: Sep 28, 2012 10:42 AM by optics42 RSS

    Error exporting as JS

    Luis Solivan Community Member

      Hi everyone,

       

      I'm getting this error message trying to export Flash project into JS

       

      The following JavaScript error(s) occurred:

       

      At line 77 of file "/Users/luis/Library/Application Support/Adobe/Flash CS6/en_US/Configuration/CreateJS/jsfl/Matrix2D.jsfl":

      TypeError: str has no properties

       

       

      Help!

        • 1. Re: Error exporting as JS
          GmR

          I am getting the same error!  Were you able to resolve it?  Can anybody offer advice?

           

          I am trying, for the first time, to output an older fla movie currently using Actionscript 1.  Using Mac.

           

          thanks,
          Geoff

          • 2. Re: Error exporting as JS
            Luis Solivan Community Member

            Nobody ever responded... sucks.

            • 3. Re: Error exporting as JS
              SuhasYogin Employee Hosts

              Hello,

               

              Did the FLA you were trying to convert have ActionScript? If yes, then Toolkit for CreateJS does not support conversion of Action Script code to HTML5 equivalents (JavaScript). There are a couple of workarounds you could use:

               

              Embed Javascript Code within Action Script comment blocks for components that have been designed using ActionScript in your FLA.

              Or convert the entire FLA to HTML5, explicitly identify ActionScript components, and find their JavaScript equivalent codes from http://www.createjs.com/Docs/EaselJS/

               

              Hope this helps. Please let me know if you have any more questions.

               

              Regards,

              Suhas Yogin

              • 4. Re: Error exporting as JS
                GmR Community Member

                That's a pity.  At any rate, I have now watched the video by Grant Skinner (http://www.adobe.com/devnet/createjs/articles/using-flash-pro-toolkit-createjs.html), and I see that the Actionscript is ignored, so it's not that. 

                 

                Please let us know if you find what the error is about.'

                 

                Cheers,
                Geoff

                • 5. Re: Error exporting as JS
                  GmR Community Member

                  Thansk Suhas, but because the AS is ignored, I don't think that is causing the error?  Thanks for the link!

                   

                  Geoff

                  • 6. Re: Error exporting as JS
                    SuhasYogin Employee Hosts

                    Hello,

                     

                    I am looking in to this and will get back to you soon as I have answer.

                     

                    Thank you for your patience,

                    Suhas Yogin

                    • 7. Re: Error exporting as JS
                      GmR Community Member

                      Much appreciated!

                      • 8. Re: Error exporting as JS
                        Mohanaraj Adobe Employee

                        Hi Luis and Geoff,

                        Can you please download and insatll the latest CreateJS Toolkit available at http://www.adobe.com/devnet/createjs.html

                        I hope the latest Toolkit (V 1.0.0) version will resolve your issue. If not, can you please share the problematic file(s) and snap shot of your Toolkit for CreateJS panel?

                         

                        Thanks!

                        Mohan

                        • 9. Re: Error exporting as JS
                          GmR Community Member

                          Mohan, I already have V.1.0.0 installed, but will download, install and try again.

                           

                          Thanks,
                          Geoff

                           

                          PS>  OK, have just downloaded and installed, and noticed the current version is 0.3.20.  Is this later than v 1.0.0?

                          • 10. Re: Error exporting as JS
                            GmR Community Member

                            Mohan, I used the download link on the right, and reinstalled v 1.0.0  - Same error, but managed to get rid of it by hiding some problem layers.  Generally working fine!

                             

                            thanks agian,
                            Geoff

                            • 11. Re: Error exporting as JS
                              Mohanaraj Adobe Employee

                              Hi Geoff,

                              V.1.0.0 is the latest Toolkit version and please download it from http://www.adobe.com/devnet/createjs.html page as shown in the screen shot.

                              CreateJSToolKit.png

                               

                              If this is not working for you then please share the problematic files and the screen shot of your Toolkit for CreateJS panel.

                               

                              Thanks!

                              Mohan

                              • 12. Re: Error exporting as JS
                                GmR Community Member

                                Thanks Mohan... yes I now have it working. (see my previous email).

                                 

                                regards,

                                Geoff

                                • 13. Re: Error exporting as JS
                                  dtexus

                                  Started a new, related thread.

                                   

                                  http://forums.adobe.com/thread/1063704

                                  • 14. Re: Error exporting as JS
                                    optics42 Community Member

                                    Is there something special about 'Line 77' in JavasScript?

                                    I've just been asked about CreateJS producing

                                     

                                              At line 77 of file "TextInst.jsfl":

                                              TypeError: str has no properties

                                     

                                    Line 77 errors seem to crop up in a variety of  "xxxx.jsfl" files

                                     

                                    The current cure appears to be going through the .fla deleting code/layers until the problem goes away.

                                     

                                    Is there a better/simpler solution?

                                    • 15. Re: Error exporting as JS
                                      dtexus Community Member

                                      Can you tell us something about the layer that you delete that makes the problem go away? In my case it was classic text with emboldened type that was cauing the error. If it's the same for you then that would probably be very helpful info for the people maintaining CreateJS.

                                       

                                      The jsfl file is masked so we can't easily help ourselves.

                                      • 16. Re: Error exporting as JS
                                        optics42 Community Member

                                        In this case we tracked it down to a text box (Classic/Static text), part bold, part regular.

                                         

                                        Splitting the text off into 2 separate boxes produced the same error.

                                         

                                        Deleting the box with the regular text removed the error message.

                                        Creating a new text box and retyping the regular text allowed an HTML/js output.

                                         

                                        Fortunately the .fla only contained 3 layers and 9 frame sets, so it's only taken 3 hours to locate.

                                         

                                        ...there's still the 'Syntax error in line 7..." of the .js file to deal with (an error at line 7 occurs with every . fla that is 'converted') and then a chunk of concatenated code further on and then there's the looping...

                                         

                                        Can we keep Flash please??

                                         

                                        BTW. Any suggestionas to how the looping can be fixed?

                                        There's probably a good reason why the now converted .js contains multiple blocks commencing with

                                                   (lib.somethingOrOther= function(mode,startPosition,loop) {

                                                      this.initialize(mode,startPosition,loop,{},true);

                                        We've tried adding  p.loop = false; and loop = false; neither affect the looping...

                                        • 17. Re: Error exporting as JS
                                          dtexus Community Member

                                          I could not turn off looping either. That method and property seem to have no effect. I've resorted to removing all frame based animation and just relying on the toolkit to export assets to canvas, and then doing all my interactivity and animation in the JS. Those blocks you mention are modules with closure. They encapsulate thing like layers, buttons and scenes. They give us a nice scene graph for managing the elements on the canvas. It really is pretty cool, it's just not fully baked yet.

                                           

                                          We'll see if we get any kind of response now that we've isolated the type of elements that trigger the error. I'm worried because I suspect Adobe has all their Flash/Canvas experts working on a product that is targeted for generating Canvas animations from the get go and the CreateJS toolkit for Flash will never be more than it is now (it seems inevitable).

                                           

                                          As for fixing the bold text, I don't see an obvious or easy way to mix regular and bold text using the EaselJS API, nor do I see a way to use multiple colors. Worse, there is no easy way to do it in the Canvas specification (which I'm sure is the reason support for text in the toolkit is so poor right now. Exporting the text as shapes creates ridiculously big JS files so tha toption is out. We can always create the text in HTML and lay it over the Canvas but I'm trying to achieve the ability for my Flash person to make changes to the SWF version but generate a file that I can just re-export to update the Canvas version. I'm using grunt.js to run the exported JS against a bunch of regex expressions and fix the things that don't work, but I'm stumped by this text problem.

                                          • 18. Re: Error exporting as JS
                                            optics42 Community Member

                                            Many thanks for your detailed reply. No light at the end of the tunnel, then?

                                             

                                            I'm thoroughly depressed by the whole fiasco (as it seems to me) for dropping Flash.

                                             

                                            This a.m. I came across an "Adobe Evangelist's" anim demo for CreateJS...the demo depended on embedding /* js strings */ to run..

                                             

                                            So I now have to learn js  to insert js code into a Flash-to-JS converter?..it's bonkers...

                                             

                                            ...particularly as, from what you say, js won't reproduce the Flash anyway.

                                             

                                            I will persevere but I feel, by comparison, Sysiphus had it easy...

                                            • 19. Re: Error exporting as JS
                                              optics42 Community Member

                                              Update on looping...clips suggestion not tested

                                               

                                              From. ta11us,   25-Sep-2012 09:04  

                                              "If you want to stop the main timeline looping there's a checkbox in the toolkit publish settings.

                                              If you want to stop individual clips then you can use js

                                              /* js

                                              stop();

                                              */

                                              see http://www.adobe.com/devnet/createjs/articles/using-flash-pro-toolkit- createjs.html for more info"