How to scroll two timelines in two file in one page?

Hello,

I can scroll timelines in one Hype file by using:

window.onscroll = function () {
	
	var scrollAmount = scrollY;
	hypeDocument.goToTimeInTimelineNamed(scrollAmount * 0.006, 'timelineprodcut')
        hypeDocument.goToTimeInTimelineNamed(scrollAmount * 0.006, 'timelineprodcut2')

}

like this one https://www.lovcour.com/one-productscroll-timeline

But, if put these two timelines animation into two hype files, and put two animations into one page, both of them will not work, and you may check the test page at:

https://www.lovcour.com/twoproductscrolltest

Anyway to make them work please? Thanks

Alex

via js-library:

or here:

Thanks, I will have a try:)

Alex