0 Replies Latest reply on Jun 12, 2013 9:01 AM by PatrickSloan

    Composition runs properly locally, but buggy remotely

    PatrickSloan

      Hi friends. Just want to preface that the following composition works locally whether I am launching an Edge Animate Preview, or looking at the composition through http on my local Apache installation.  When I access the composition through a remote server, is when the errors occur.  The silver lining is that the same errors occur regardless of who is accessing the page across location and browser. 

       

      With that I'll post the document.compositionReady code:

      ]

      /* Initialize Sound */

       

       

      var assetsPath = "media/";

      EC.Sound.setup(

          [

              {src: assetsPath + "Coaching_5.mp3|" + assetsPath + "Coaching_5.ogg", id: "slide_5"},

              {src: assetsPath + "Coaching_5a.mp3|" + assetsPath + "Coaching_5a.ogg", id: 'slide_5_1'},

              {src: assetsPath + "Coaching_5b.mp3|" + assetsPath + "Coaching_5b.ogg", id: 'slide_5_2'}

          ],

          function(){ EC.info("Sound setup finished", "DEMO"); }

      );

       

       

      /* Initialize Z-Indexing */          

       

      var currZI = 1000;

       

       

       

      /* Apply functionality to the two buttons */

       

       

      sym.$("polaroid_1").click( function() {

       

       

                shiftButtons(1);

       

       

      });

       

       

      sym.$("polaroid_2").click( function () {

       

       

                shiftButtons(2);

       

       

      });

       

      /* shiftButtons will trigger a series of GSAP animations to show popup content based on selected photo icon */

      function shiftButtons(_arg)

      {

                stopAllAudio();

                playAudio(_arg);

                if (_arg == 1)

                {

                   sym.$("polaroid_1").css({ "position":"absolute", "z-index":currZI});

                   TweenMax.to(sym.$("polaroid_1"),1,{css:{left:680, top:70}});

                   TweenMax.to(sym.$("polaroid_2"),1,{css:{left:680, top:170}});

                          TweenMax.to(sym.$("popup_1"),1,{css:{left:33}});

                          TweenMax.to(sym.$("popup_2"),1,{css:{left:1000}});

                          EC.info( "clicked on pic 1, depth = " + currZI);

                          currZI++;

                }

       

       

                else if (_arg == 2)

                {

       

       

                   sym.$("polaroid_2").css({"position":"absolute", "z-index":currZI});

                          TweenMax.to(sym.$("polaroid_1"),1,{css:{left:0, top:170}});

                          TweenMax.to(sym.$("polaroid_2"),1,{css:{left:0, top:70}});

                          TweenMax.to(sym.$("popup_1"),1,{css:{left:-1207}});

                          TweenMax.to(sym.$("popup_2"),1,{css:{left:481}});

                          EC.info( "clicked on pic 2, depth = " + currZI );

                          currZI++;

                }

      }

       

       

      function playAudio(_arg)

      {

       

       

      EC.info( "audio trigger: " + _arg);

      EC.Sound.play("slide_5_" + _arg);

       

       

      }

       

       

      function stopAllAudio()

      {

         //EC.Sound.stop("slide_5");  // Not used for now

         EC.Sound.stop("slide_5_1");

         EC.Sound.stop("slide_5_2");

      }

       

      What's happened here when viewed remotely, some of the Tween instructions were "skipped" (not executed).  I solved the problem with the two popups not firing by simply combining them into a single div and "pushing" that single div with all of the popup content around the stage.

       

      After that however, I'm finding that remotely, the first time audio should play (when launched by a button click) it does not play.  Every subsequent audio trigger works, just not the very first one.  I'm wondering if there is a conflict here with the stopAllAudio() function. 

       

      Thank you.

      Patrick