Hi @namisuki
I added an info panel to your demo so you can see what's going. It makes debugging a lot easier.
Before getting to the switching of the timeline part, there are some issues/questions you should look at first.
Your check for the collision will never be true. It's a pixel short because of the border. Notice in my code how I'm adding 151 instead of 150.
Are the animation/timeline changes supposed to happen only once, or every time the scroll position passes a certain break point? For example, if the second timeline is playing, and you scroll up, should it switch back to the first timeline? If so, rotating the building will cause the building's left positional value to change, which might mess stuff up.
And what progress value are you going to feed to the second timeline? You can see that the window scroll value goes above 1 after the boxes are colliding. Progress should be a value from 0 to 1.