# Looping to load different text files

**URL:** https://forum.kirupa.com/t/looping-to-load-different-text-files/80525
**Category:** flash
**Created:** [February 22, 2005, 9:18pm UTC](https://forum.kirupa.com/t/looping-to-load-different-text-files/80525 "2005-02-22T21:18:16Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![JP\_West](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@JP\_West](https://forum.kirupa.com/u/JP_West)
#### Post date: [February 22, 2005, 9:18pm UTC](https://forum.kirupa.com/t/looping-to-load-different-text-files/80525/1 "2005-02-22T21:18:16Z")

</div>

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.
