Run Javascript within Shared Action
Hey everyone - so I have been using Javascript, Shared Actions, and other advanced coding topics for a while now in Captivate 2019 or Captivate for Developers as I think of it (whilst 2023 is Captivate for Designers).
I have a project that is about 70 slides long and plays audio on 50 of them.
It is easy enough to get audio to play per slide. My issue is that on each OnEnterFrame I fire a Javascript function that controls the length of a completition bar per slide. Because I can only fire one thing per OnEnterFrame, I began looking for solutions.
a) attach the audio to an invisible shape per slide. The first audio plays. Subsequent do not.
b) create a shared action - using an advanced action that fires the Javascript then plays the first audio file, I then created a shared action that would (I assumed!) allow me to set the javascript then ask for which audio to play. Of course it didn't work that way and even though the Select which audio to play appeared, the javascript code was not there.
c) I could creat a pure javascript method but I am thinking of other developers on my team who are not so versed in JS and I would like as much an in house to Captivate solution as possible.
d) I could create one advanced action with a Decision IF statement per slide that requires audio. If variable = 0 play first audio, then increment variable to 1. Subsequent call of advanced action, if variable = 1 etc...
Except Captivate with decisions excecutes ALL Decisions at once. I've never found a way for Captivate to stop executing decisions once a positive match is made for the IF statement.
d) finally there is the sledgehammer choice - from my perspective the overkill which is ONE Advanced Action per slide that fires the javascript then the appropriate audio.
From a programming point of view D is ridiculous. Is there any other way of doing what I feel is quite simple?
thanks
