Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

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

$
0
0

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

sym.stop(time);

 

// Play the audio track.

sym.$("rafting_audio_element")[0].play();

 

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


Viewing all articles
Browse latest Browse all 9897

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>