I have an animation setup
var animation = bodymovin.loadAnimation({
container: document.getElementById('network-build-vid'), // the dom element
renderer: 'svg',
loop: false,
autoplay: false,
path:"_json/data.json" // the animation data
});
I start the animation inside of another function:
function test(){
animation.play();
}
I can't seem to get the event 'complete' or 'onComplete' to fire when the 1 second animation is done. I do get feedback from 'DOMLoaded' so I know I've set it up correctly.
animation.addEventListener('complete', test2);
animation.addEventListener('DOMLoaded', test3);
function test2(){
console.log("say hi");
}
It fired. I should have checked my test AE animation; the entirety of the comp was rendered instead of the 1 second of animation that was created.
I found this out by using currentFrame and totalFrame to see the animation was 'still playing'.
``javascript
console.log(animation.currentRawFrame);
console.log(animation.totalFrames);
Most helpful comment
It fired. I should have checked my test AE animation; the entirety of the comp was rendered instead of the 1 second of animation that was created.
I found this out by using currentFrame and totalFrame to see the animation was 'still playing'.
``
javascript console.log(animation.currentRawFrame); console.log(animation.totalFrames);