7 Replies Latest reply on Jul 21, 2014 8:02 AM by smenegassi

    hide and show

    smenegassi Level 1

      Hello

       

      I was trying to hide an element for the last two hours... changing computers and browsers. Easy isn't it ?

      Well it didn't work till I took my command : sym.$("message").hide(); from creationComplete into compositionReady.

      In compositionReady it works.

       

      Can anyone in this word, please, tell me what is the difference in between creationComplete and compositionReady ?

      thank you

      s.

        • 1. Re: hide and show
          resdesign Adobe Community Professional & MVP
          • 2. Re: hide and show
            smenegassi Level 1

            Thank you resdesign,

             

            but it is very confusing. You mean I have an address problem ?

            My symbol is on the stage and I only want to hide it.

            I don't know why it works when the command hide() is on compositionReady and it doesn't work when it  in creationComplete

            I still don't see the difference in between them. I don't find anything about it on the Edge Animate javascript API

            • 3. Re: hide and show
              resdesign Adobe Community Professional & MVP

              To quote Elaine Finnell,


              compositionReady is an event that is run once at the beginning of the composition's load phase.  creationComplete is run when a symbol has completed loading.  Since the Stage is a symbol, it has a creationComplete event as well.


              or by same Elaine:

              All symbols have a creationComplete event, including the Stage (which is itself just a big symbol).  documentReady only fires when the page is loaded, but the Animate events (creationComplete, compositionReady) will only fire after the Animate runtime is loaded.  If I were to hazard a semi-educated guess, I'd say that documentReady likely will fire before the Animate runtime events, though you might hit a race condition where both of them will fire at about the same time.

              1 person found this helpful
              • 4. Re: hide and show
                smenegassi Level 1

                Thank you.

                I still don't see why I couldn't hide my symbol. but thanks for your explanation. I'll have to dig a little more on the subject.

                • 6. Re: hide and show
                  jbowden Adobe Employee

                  Hi all,

                   

                  Actually, the Animate runtime is loaded before the compositionReady event fires - that's the difference between HTML document.ready and Animate compositionReady events.

                   

                  Regarding the events mentioned in this thread, here's the order in which they are loaded in the browser:

                  1. symbol creationComplete
                  2. Stage creationComplete (because the Stage symbol contains all child symbols)
                  3. Stage compositionReady

                   

                  For tasks like styling or hide/show elements in the composition, compositionReady is the event to use as it fires after all symbols have been created.

                   

                  hth,

                  Joe

                  1 person found this helpful
                  • 7. Re: hide and show
                    smenegassi Level 1

                    I just saw it now. Thank you all.

                    ... I'am beginning to see the light ! :