How do flaps deploy and stow with very large wing flex? On large airliners, the wings are generally of the high aspect ratio types and hence very flexible. Now the flaps are attached to wing only through a series of tracks, and as the wings flex, these tracks change relative positions to one another as well. How is the flap designed so that it can ride on these tracks regardless of their positions? I scoured the internet for answers and the only vague one I got is this description


  One of the flap tracks positions the flap and all others absorb horizontal displacement.


Intuitively this is like designing a door that can open and close with a doorframe that is sometimes straight and sometimes crooked. Is the door also flexible itself?

This question applies to not just flaps, but to spoilers, speed brakes and leading edge slots or drooping leading edges as well. How are they designed?
If the flap is on 3 tracks, it flexes with the wing and there is compliance built into track system.  If the flap is on two tracks, it'll stay straight as the wing in front of it curves.  But in a two track system, the panel is short enough that the wing curvature is negligible to the flap.

What that statement means is that with a 3 track panel, as the flap flexes with the wing, the total distance between the 3 tracks gets longer and shorter by some value, say an eighth or quarter of an inch or whatever.   To accommodate this the center track is used to control the lateral position of the panel, while the inner and outer track has lateral side play built in to the roller system so the change in distance doesn't cause binding in the outer tracks.

Slat systems are the same. The center track has guide rollers that locate the slat and the outer ones are "floating" laterally by having larger roller clearances.  Other panels on the wings like spoilers that are much shorter are able to get away with just using spherical bearings that allow some compliance as everything moves.