7 Replies Latest reply on Jul 7, 2013 7:17 AM by SEIF BH

    Is there a way for EA to automatically save json & sound files to project & publish directories?

    seriouscodecreator Level 2

      Is there a way for EA to automatically save json & sound files to project & publish directories? Thanks

       

      Bob

        • 1. Re: Is there a way for EA to automatically save json & sound files to project & publish directories?
          Zaxist Level 4

          what do you mean by automatically ?

           

          you want to edge create files by it self ? creating files that doesnt exist ?

          • 2. Re: Is there a way for EA to automatically save json & sound files to project & publish directories?
            seriouscodecreator Level 2

            I meant that I would like a mechanism where I could add - let's call them 3rd party files - to a EA project so that they would be published along with all the regular EA files. AND I frequently save new versions of my projects in new subdirectories with new filenames - so as to preserve a working version from being totally screwed up by me that I can go back to if necessary. Unlike you, I am not that skilled and frequently make mistakes that render some of my new code attempts totally unusable.

             

            Oh, BTW I tried YOUR suggestions about deleting child symbols and I finally got it to work with the following code:

             

            var childSymbols = sym.getChildSymbols();

                                                    for (var j=0; j < childSymbols.length; j++) {

                                                      sym.getSymbol(".childsymbolclassless").deleteSymbol();

                                                    }

             

            I guess "sym.getChildSymbols()" is some JavaScript understood term for any child symbols created no matter what their named or maybe its some kind of object type or variable type, like number or text. You see I really have no clue why this works, I just steal from others or follow their suggestions. The Edge Animate JavaScript 2.0 docs state:

             

            // Set the child symbols variable

            var childSymbols = sym.getChildSymbols();

            for(var i=0; i<childSymbols.length; i++) // Return the number of direct children

                childSymbols[i].stop(); // Stop all of the children

             

            This didn't do what I wanted - which was to delete the child elements from the screen. And I believe I tried using "delete" rather than stop but that didn't work either

             

             

             

            AND this also worked:

             

            function delCSymbols(i){for (var j=0; j < i; j++) {

                                                      sym.getSymbol(".childsymbolclassless").deleteSymbol();

                                                    }

             

            where "i" was used previously to create the child symbols. 

             

            Thank YOU,  YOUR suggestion of using the .ClassName helped.

             

            One thing I have not figured out is when trying these solutions from outside - using another symbol click event for example - only one of two of these child creations are deleted.

             

            If I use this code in the same click  event - at the end for instance - it works on both individually.

             

            This works (from another click event):

             

            var childSymbols = sym.getChildSymbols();

                                                    for (var j=0; j < childSymbols.length; j++) {

                                                      sym.getSymbol(".childsymbolclassless").deleteSymbol();

                                                      sym.getSymbol(".dchildsymbolclassless").deleteSymbol();

                                                    }

             

            but only for the length of the first .childsymbolclassless, in other words if there is only one childsymbolclassless but TWO Dchildsymbolclassless childs only one of those is deleted. Running/clicking the function twice doesn't work either - at all if you must know. I am sure that you know why, but I do not.

             

            Try and error and a few hours sleep yields a stumbling onto to something that works - Creating another duplicate delete child symbol button and reversing the order does it. Like this:

             

            var childSymbols = sym.getChildSymbols();

                                                    for (var j=0; j < childSymbols.length; j++) {

                                                      sym.getSymbol(".dchildsymbolclassless").deleteSymbol();

                                                      sym.getSymbol(".childsymbolclassless").deleteSymbol();

                                                    }

             

            placing D class first then nonD class

             

            Do You have a good suggestion for an editor that won't screw up Edge Animate? I find my version of notepad doesn't format correctly and write blows up the program. Does Adobe Edge Code CC work okay? Thanks for reading all of my incoherent stuff. And thanks for helping me solve some of my problems.

             

            Bob

            • 3. Re: Is there a way for EA to automatically save json & sound files to project & publish directories?
              Zaxist Level 4

              well edge wouldnt copy all external files that you added to your project in to publishing folder, you should doing copy paste your files and folders created by your self after published !!

               

              and i cant undrestand "Unlike you, I am not that skilled and frequently make mistakes that render some of my new code attempts totally unusable." you can save your project everytime with new name to have your previews works !!

               

              and about removing your symbols that uses class name, you are doing wrong, you should doing this way

               

              sym.$(".Preview").remove();

               

              and thats why you cant get it to work

               

              if tehre is any question feel free to ask me

               

              Zaxist

              • 4. Re: Is there a way for EA to automatically save json & sound files to project & publish directories?
                seriouscodecreator Level 2

                Yes sym.$(".childsymbolclassless").remove(); worked for both from another symbol's click event. Thanks.

                 

                Bob

                • 5. Re: Is there a way for EA to automatically save json & sound files to project & publish directories?
                  seriouscodecreator Level 2

                  Yes I know I can save it under a new name in a new directory, but then I have to remember to copy my sound files and json file every time and I do forget sometime, spending time wondering why my code doesn't work.

                   

                  Bob

                  • 6. Re: Is there a way for EA to automatically save json & sound files to project & publish directories?
                    Zaxist Level 4

                    i'm sorry Bob but because AEA Projects was not for designing a complete website they didnt put this ability to copy all of your files when you save or publish...

                     

                    for Now the only way is you do the copy part by your self !!

                     

                    and about third party, if you create your prjects you can change some  small codes or add some codes to your Edge Action part by editing YourProjectName_edgeActions.js file in dreamweaver or codelobster, but they cant create a new element in your project for you... !!

                     

                     

                    hope these helps

                     

                     

                    Zaxist