I have an animate cc (so a canvas) movie in a page but I have a lot of content before and the animation doesn't show directly in the viewport, we must scroll to see it. I would like my animation to launch ONLY when I scrool and when it appears on the page.
Can someone help me please? I could do it in the past with Edge animate but never found any documentation about that script in animate cc..
Thanks a lot !
var px_to_mc = 100;
var scroll_function = scrollF.bind(this);
var scrollTop = window.pageYOffset || (document.documentElement || document.body.parentNode || document.body).scrollTop;
Thanks for the answer but I'm sorry.. I don't know how to use it.. do I have to add it in Animate CC in the action panel or in a separated js code in my page ?
thank you !
so I guess this.mc.play(); -> mc is the movieclip that has to launch ?
yes, that's the place-holder for the movieclip that you want to play when the page is scrolled. px_to_mc is the number of pixels the page must scroll to bring that movieclip into the viewport.
Sorry I don't understand.. it was so easy in Edge Animate and I'm new in Animate CC
Can you provide me a working example please?
Thank you a lot !!! I'm going to try this example !!!
Have a nice day !
hi kglad, i want to understand the same, but your above examples files are not availabe on mentioned link, can please provide me the same. thanks in advance
Do you have the same code to launch animation when visibility is "true" ?
It would be so useful as i work with iframe for my animations
Thks a lot
still didn't manage to make the example work..
for the moment I focuse on trying to load external content into an animate cc comp just like it was possible in flash many years ago via actionscript (loadmovie) but not anymore with the new animate cc.. it's really a pain