I’m trying to create a flash ticker that displays the current song and artist info for a radio station. The radio station’s server is automatically outputting a new text file to me (a separate web server that I’m working on) everytime a new song starts. I’m then using a PHP file to “echo” out that info.
I’ve been successfully able to display that song info through a flash file by using “loadVariablesNum” and then looping back to the 1st frame. With this method, the song info is appearing to “automatically” update when new song data arrives.
The problem I’m having is that when a song ends and commercials start airing, the flash ticker still shows the name of the last song. I’m trying to find a solution that will revert to generic text once commercials start (or DJs start talking).
In addition to song title and artist, I’m also getting song length in hh:mm:ss format. I figure with that info and the current server time (which I could get from the PHP file or the Flash file), I’ll be able to know when each song is over. If another song doesn’t start immediately afterwards, I can then display a generic text message until the next song starts up.
I like the way the News Flasher component works but am not sure how to get it to continuously check for new song data. It seems to cache the info unless I manually refreash the web page. I also realize that checking every 5 or 10 seconds for new song data is going to be server intensive and not practical. That’s why I’m thinking that the solution would be to have a Flash timer that counts down from the current song length to “0”. When it hits zero, it can then start checking for new song data.
Not knowing actionscript very well, does anybody have a solution for this?