16 Replies Latest reply on May 30, 2015 1:23 PM by resdesign

    Unload a loaded composition

    Allison@HavasLynx Level 1

      Hi,

      I have been searching for an answer for a few hours now and I can see a few people have asked the same question but it has not been answered.

      I have created my main page in Edge Animate 2014.1.1

      It has a main navigation bar with 5 buttons.

      Each button uses the EA Commons "loadComposition" function to load one of five compositions into the main page.

      This all works fine, with the correct compositions loading into a div called 'content' on a click function like this:

       

      Symbol.bindElementAction(compId, symbolName, "${cascade-1-btn}", "click", function(sym, e) {

               EC.loadComposition("comp1/index.html", sym.getComposition().getStage().$("content"));

            });

       

      In the main page I also have another button which, when clicked should remove any composition that has been loaded into the 'content' div and make it empty.

      Surely if you can load a movie you should be able to unload it as well?

       

      Any help greatly appreciated.

      Many thanks

      Allison

       

        • 1. Re: Unload a loaded composition
          Allison@HavasLynx Level 1

          Hi - can anyone help with this please?

          Thanks

           

          • 2. Re: Unload a loaded composition
            resdesign Adobe Community Professional & MVP

            I have not used that but I would assume you can use deleteSymbol() since the Stage is a symbol.

            • 3. Re: Unload a loaded composition
              Allison@HavasLynx Level 1

              Thank you for your help - I will try that now

               

              • 4. Re: Unload a loaded composition
                Allison@HavasLynx Level 1

                Hi resdesign,

                I tried your suggestion but it didn't work for me.

                 

                The buttons (there are 5 in total) that load the compositions into the div called "content" use this:

                EC.loadComposition("comp5/index.html", sym.getComposition().getStage().$("content"));

                 

                So for the button that unloads them I tried this:

                sym.getComposition().getStage().$("content")deleteSymbol();

                 

                Can you see where I might be going wrong please?

                Thanks

                • 5. Re: Unload a loaded composition
                  resdesign Adobe Community Professional & MVP

                  You are missing a period.

                  sym.getComposition().getStage().$("content").deleteSymbol();

                  • 6. Re: Unload a loaded composition
                    resdesign Adobe Community Professional & MVP

                    Sorry you need this:

                    sym.getComposition().getStage().deleteSymbol('content');

                    or

                    sym.getComposition().getStage().deleteSymbol();


                    This removes everything.


                    let me check this further.

                    • 7. Re: Unload a loaded composition
                      Allison@HavasLynx Level 1

                      Hi,

                      Thanks for your quick replies!

                       

                      I tried the last one but it removes everything from the stage.

                      I just need to unload the composition that is loaded into the div called "content", leaving everything else on my main stage intact.

                      I need the div "content" to remain on the stage as an empty div, because the user may click one of the buttons to load another composition into it.

                       

                      Thanks

                      • 8. Re: Unload a loaded composition
                        resdesign Adobe Community Professional & MVP

                        Yes I saw that.

                        I have this working:

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

                        • 9. Re: Unload a loaded composition
                          Allison@HavasLynx Level 1

                          Sorry - I still can't get it working.

                          I thought it might be a path issue because of nesting in my comp so I even tried:

                          sym.getComposition().getStage().getSymbol("content").deleteSymbol();

                          but that didn't work either.

                           

                          Just downloaded the files you have sent me - thanks for this!

                          I have to go home now but I will have a look tomorrow to try and replicate.

                          I was about to try and upload my files to show you but my project is 7mb even when compressed!

                           

                          Will let you know.

                          Thanks

                           

                          • 10. Re: Unload a loaded composition
                            Allison@HavasLynx Level 1

                            Morning resdesign,

                            Thanks again for all your help!

                            I downloaded your files and although the untouched index.html file works perfectly in a browser, when I opened it in edge animate it told me it had been created in a previous version of the software and 'upgraded' the files, when I published from there it wouldn't work! (screenshot attached)Screen Shot 2015-05-14 at 09.34.34.png

                             

                            I have never used an earlier version of EA, and I am working on a large project using EA for the first time. Before I started it I gathered together all the tutorials I would need to create the functionality required, but I am frequently finding that they are for the earlier version of the software, and I don't know what to do to make them work in my version.

                             

                            The client has specified this version of EA (Edge Animate 2014.1.1) to build the job so I can't use an earlier version. Do you know what I need to do to make the older EA code work in my version please?

                             

                            I have checked the paths in the code but they are all local ones so I can't see why it would do this. If I knew this I could probably fix all the other things I am having trouble with as well.

                            Thanks

                            Allison

                            • 11. Re: Unload a loaded composition
                              Allison@HavasLynx Level 1

                              OK I think I have got it working - kind of!!

                               

                              When it 'upgraded' the composition - the folder did not contain the external compositions that are being loaded in, so that's why it can't find them.

                              I have duped them over and it's loading the first composition but not the second.

                              This is probably enough for me to work from though - so thank you for supplying these files.

                              I am going to look at the other tutorials that my cope of EA has 'upgraded' and see if this is the problem there as well.

                              Thanks

                              Allison

                              • 12. Re: Unload a loaded composition
                                resdesign Adobe Community Professional & MVP

                                Sorry, I have been swamped today. I do not like the new version and use on rare occasions, mostly to help people because I use jquery a lot and sometimes the new version messes things up. I do not have time to debug since I have a LOT of work on my plate.

                                I will try and see if I can make this work for you in the new version. You would need to have the new js file for Edge Common as Simon had to update it when the new version came along.

                                • 13. Re: Unload a loaded composition
                                  Allison@HavasLynx Level 1

                                  That's absolutely fine - I am currently looking at these issues and will post back if I find a solution.

                                   

                                  I am also trying to learn JS and jQuery after coming from an Actionscript background.

                                  I have some knowledge as AS is similar but sometimes I fall down on the syntax.

                                   

                                  I appreciate that you must be busy - you have helped me a lot already.

                                  Thanks


                                  • 14. Re: Unload a loaded composition
                                    resdesign Adobe Community Professional & MVP

                                    did you get things resolved. Like I said before I have been swamped at work. Let me know. I have some time today if you still need me to.

                                    • 15. Re: Unload a loaded composition
                                      Allison@HavasLynx Level 1

                                      Hiya,

                                      I didn't exactly resolve the issue - I managed to get all the comps loaded in when the relative buttons are clicked, but cannot unload any of them with a button click.

                                      I cheated by altering the z-index of the 'content' symbol in order to hide it behind something else instead of unloading the loaded movie. Seems to be ok so far, but the project is nowhere near finished yet. There is a lot of content to add in and there are other things I'm stuck on.

                                      However, I am working on something else at the moment so it's on hold for a few days.

                                      Thanks for checking in with me though.

                                       

                                      • 16. Re: Unload a loaded composition
                                        resdesign Adobe Community Professional & MVP

                                        Leearning javaScrip and jQuery as well as css is the best thing you can do. I wish all designer would get the idea that this makes them more marketable.