4 Replies Latest reply on Jun 2, 2014 9:42 AM by btaartdirector

    Play Audio On Scroll?? (nothing works for me...)

    btaartdirector Level 1

      I am using a form of parallax on the stage which controls the time playback based on the position of the scroll. This app (page) will be part of an iPad DPS package (one of many pages). I am including the script from the stage, and a link to download the package. I want the audio to play only when the user begins scrolling. It can play through then stop. I have tried placing it on the timeline and setting a playback action at a point on the timeline - nothing; I have tried making it play by putting it into a symbol and adding actions at keyframes on the timeline to play the audio -- nothing. The only way it will play is by selecting the autoplay option in the element properties which is not what I want. I have also tried (see below) an action on the stage to play the audio:


      // insert code for scroll event here

      var animationHeight = 5120;

      var stageHeight = sym.$("Stage").height();

      var scrollPos = sym.$("Stage").scrollTop();

      var duration = sym.getDuration();

      var percent = scrollPos / (animationHeight - stageHeight);

      var time = duration * percent;


      // Update timeline



      // Play the audio track.



      I think it has something to do with the time=duration*percent; -- I think it is preventing the audio from being played in realtime? YES / NO? Any help GREATLY appreciated.

      Thanks in advance!!


      LINK TO PUBLISHED ANIMATE FILES (not finished)...

      Dropbox - edge