# Best Auto Refresh Technique

**URL:** https://forum.kirupa.com/t/best-auto-refresh-technique/66410
**Category:** Uncategorized
**Created:** [October 5, 2004, 6:19pm UTC](https://forum.kirupa.com/t/best-auto-refresh-technique/66410 "2004-10-05T18:19:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sky131](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@sky131](https://forum.kirupa.com/u/sky131)
#### Post date: [October 5, 2004, 6:19pm UTC](https://forum.kirupa.com/t/best-auto-refresh-technique/66410/1 "2004-10-05T18:19:40Z")

</div>

I have a swf file that dynamically reads the ID3 tag of what I have playing on my Internet radio station. It then shows what is currently playing and has a button to login to the stream.

Right now I am using setInterval to check and see if the song has changed and I was wondering if there is a better way to do it?

Right now my code looks as follows:

```auto
songInfo = function()	{
	loadText = new LoadVars();
	loadText.load("trackinfo.txt");
	loadText.onLoad = function() {
	song = this.song;
	album = this.album;
	artist = this.artist;
	final = (song + album + "<B>" + artist + "</B>");
	};
};

songInfo();
setInterval(songInfo, 50);

```

Does anyone know if there is a way to only reload if the data in trackinfo.txt changes?
