Athelstaneford Parish Kirk lies towards the west end of the village of Athelstaneford, in East Lothian. A beautifully restored doocot just beyond the north-east corner of the kirk is home to the Flag Heritage Centre, nicely located within sight of the event it commemorates.
The Flag of Scotland is the Saltire: the white diagonal cross of Scotland's patron saint, St Andrew, on a blue field. It is one of the oldest flags in the world, dating back, according to the version of the story you believe, to 832, or to 815, or to 761.
According to the most popular version of the legend, a joint force of Picts and Scots under King Angus (or Óengus) of The Picts met a Northumbrian army of Angles under King Athelstan in 832. The Picts and Scots were heavily outnumbered, and the night before the battle, King Angus prayed for victory. It is said that during the night St Andrew appeared to Angus in a dream and promised him the victory he had prayed for.
The following morning the two armies formed up for battle. As they did so, a strange cloud formation appeared, forming a broad diagonal white cross against the background of bright blue sky. The Picts and Scots believed this to be an omen: and so did the Angles. The battle that followed was an improbable victory for the outnumbered Picts and Scots. And the Saltire has been the Flag of Scotland ever since. The battle is believed to have taken place just over a mile and a half to the north of Athelstaneford near the farmstead at Prora.
A nice story, but one that has a number of problems. Athelstan wasn't actually born until 895. And he wasn't King of the Northumbrian Angles, he was the first King of England. And he didn't lose in battle to the Scots and Picts. On the contrary. At the Battle of Brunanburh, in 937, he led English forces to victory over joint Scottish and Viking armies under King Constantine II and King Olaf III Guthfrithson. This was one of the most significant battles in British history, defining forever the existence and approximate boundaries of England.
This makes the legend of the foundation of the Saltire begins to look a little like spin-doctoring in the centuries that followed, in an effort (very successfully) to airbrush the disastrous Battle of Brunanburh out of history in favour of a story that showed Athelstan in a much worse light: and the Scots more favourably.
Another version of the same story comes from a Latin history of Scotland, The Scotichronicon, written in the 1440s by Walter Bower. This has the key player the Pictish King Unust, who was fighting the Northumbrians: the story is otherwise the same. This would date the origin of the Saltire back as far as 761.
The doocot now occupied by the Centre was built in 1583 by George Hepburn, and restored in 1996. Entering the doocot triggers the start of a short audio-visual dramatisation of the events which gave rise to the Saltire which is very well done. Nearby is a viewing point with and interpretative panel, which makes the most of the views north towards the battlefield. To the south-east of the kirk is the Saltire Memorial, built in 1965 and restored in 1993.