5 Replies Latest reply on Oct 22, 2015 11:08 AM by Codeman82

    how to set and read cookies in adobe edge animate

    Emad Zedan Level 1

      Hi all,

       

      I need help in writing and reading cookies using adobe edge, is there is a way to do it I serached the internet but I did not find something simlliar?

       

      thanks in advance

        • 1. Re: how to set and read cookies in adobe edge animate
          AllDayDev Adobe Employee

          You can do so by including JavaScript that manages the cookies. Insert the necessary code into the appropriate timeline trigger (e.g. compositionReady).

           

          You can do so using JavaScript directly or via jQuery by including the jQuery.cookie plugin:

          https://github.com/carhartl/jquery-cookie#usage

           

          Let us know if you have any questions on this.

          • 2. Re: how to set and read cookies in adobe edge animate
            Emad Zedan Level 1

            Thanks for your reply, but actually I have tried to use this plug-in but I could not find a way to do it right, the documentation is not clear (I do not know what I need to import and how before I can use the provide code in the link) and it is not working on simple html page and not on adobe edge of course, and because of that I asked how to do it using JavaScript.

             

            I'm new to this technology and I want to ask if you can provide a code that I can write directly in the time line of adobe edge as what I’m trying to do is saving a cookie when the user view a specific point of the timeline and checking about that in another point on the timeline is this doable and how?

             

            Thanks

            • 3. Re: how to set and read cookies in adobe edge animate
              AllDayDev Adobe Employee

              To test with this plugin in a simple HTML page, you'll need to also include jQuery itself.

               

              For example:

              ...

              <script src="/path/to/jquery.js"></script>

              <script src="/path/to/jquery.cookie.js"></script>

              </head>

              ...

               

               

              There are a few different ways that you could load the jQuery.cookie plugin into your composition. Regardless of the method, I recommend loading it at the compositionReady trigger. This is the trigger that fires after the composition is ready to play.

               

              This blog post shows one way to load in external .js files:

              http://chrisgannon.wordpress.com/2012/09/01/loading-external-javascript-in-adobe-edge-anim ate-the-easy-way/

               

              Here's how you would be applying this method for the jQuery.cookie plugin:

              compositionReady.png

              Then enter in code similar to this:

              yepnope(
                {
                  nope:[
                    '/path/to/jquery.cookie.js'
                  ],

                complete: init
                }
              );

              function init() {

              //create your cookie's initial values here

              }

               

               

              That would load in the jQuery.cookie plugin.

               

              It would then be up to you to create/manipulate the cookie's data as needed for your purpose. Most likely, you would scroll to a point in the timeline where you want data to be changed and/or read, add a trigger, then insert the necessary code.

              • 4. Re: how to set and read cookies in adobe edge animate
                Emad Zedan Level 1

                thanks a lot Carey it is working and I test it on simple html and on adobe edge and it is working... and by the way for people who may search for my post it is working also on PhoneGap build so that you can save cookies for javascript applications as no server lanuguage is supoorted on phonegap, where i tried to save to online database using php but it is not working PhoneGap is only HTML5 CSS3 and Javascript...

                 

                Thanks

                • 5. Re: how to set and read cookies in adobe edge animate
                  Codeman82

                  Is this library still valid library?  I implemented it into my application.  Seems to work okay in a web browser, but fails to work when packaged into a phonegap application on a iPad.