Lectora Abobe Animate issue.
June 7, 2020 12:00 AM
Hello, I have an Adobe Animate Canvas animation with a stop action on the first and last frame with an audio element that starts it. When the page loads a sync event in the audio tells the canvas animation to start playing. It works great when I preview it. The issue is that once it's loaded to the LMS the audio loads faster than the canvas element in the web window and the file breaks because the sync event tries to play something that doesn't exist yet. (at least this is what I think it's happening) Does anyone have a suggestion on how to fix this issue? I'm attaching a Lectora and Animate source files and the error message. I would greatly appreciate any help.
Tom

Discussion (8)
The first thing I'd try is to use a local copy of createjs.min.js instead of the CDN. I'd also try to move the scripts themselves out of the head and put them as the last tags in the body.
It seems indeed to be a timing issue. It works when I don't autoplay the audio but play it with an action and a 0.5 s delay.
It might be possible to start the audio from animate. Then the audio should start when the animation is ready to play.
Hello Carl, it seems to me that the OnShow fires when the web window loads and not the Canvas inside the window. It seems to work with short animations but I have a couple of Animate files that are close to 2 minutes long and these take up to 3-4 seconds to load inside the web window and by then the audio is playing and out of sync.
I have not tested this, but: why not have an OnShow action for the web window that plays the audio?
OK, I did a quick test just now, and the OnShow action doesn't fire until the content is fully loaded in the web window.
Thanks guys, I wasn't able to reply earlier as this site was blocking my responses, saying I was hacked.
Tim, I don't think it's a timing issue as I've delayed the audio by 1 second and still many times audio loaded and started playing before canvas loaded into the web window and I got the same error. I even tried to play audio onshow of the web window thinking that audio won't play until the canvas content is loaded. I was wrong, the web window loaded pretty fast but the canvas loading into that web window was slow to load. I wish there was a way to add something to the Animate timeline to trigger the Lectora audio.
Darrel, thanks for your response but I'm afraid I'm not that tech savvy to try your solution.
Tom
Interesting. I tested with a very large, complex web page. (I don't have Canvas and am not familiar with it.) The page took over 45 seconds to load, but everything worked.
You can start the audio from Animate. Create a group in Lectora and add an action "Play > TEDA_02.02.030_clean". Then add "parent.runGroup_og1234();" to your script frame in Animate.
Replace og1234 with the html name of the Lectora group.
Tim, you're the best. Thank you so much, this works perfect. I really appreciate your help.
Tom
Discussions have been disabled for this post