Press the flag and don't let the balls touch the red line. You might need to press the flag a few times for it to work.
Thanks to Koby_spaceman for the original project.