Looping to load different text files

Hi, I’m trying to make a blog style page in flash… Mainly I want it to auto update the first entry when I upload a new text file (using dynamic loaded text).

Im using a date naming convention, so todays file would be 22-2-2005.txt

I can get the page to load todays file fine, but if there isnt a file that day I want flash to step back to yesterday and retry, if no file for yesterday then step back again etc.

I tried a for loop and a while loop with a load of if/else rubbish in case its the first of the month and similar situations… but both slipped into an infinite loop and i cant figure out why…

can anyone suggest code that will do this? I can post the code ive tried if needed, but i doubt it will be of any help.