If you can't get flag colors to work when you enter them, you're missing a clue. I thought the game had a glitch so I used walkthrough. Even though I FF through walkthrough to see if I had the color order right, I still saw other clues. I hate that!
SPOILER ALERT I had the color order right just going by the flags. You have to do something first before it takes the clue.