I have 5 textfields in a mc called newsbox that reads in a txt file called news.txt. I have them scroll upwards and stop on each textfield to display the text in them for a few seconds and then continue scrolling to the next one. I want it to check to see if any of the textfields contain and empty string and if so, go to an play the first frame so that you don't see any dead space.
This way, if I only have 2 pieces of news to tell you about, it won't continue to play through the other empty text fields that aren't reading anything from the news.txt file.
How can I check to see if one is empty and then play the first frame to start the loop over again?
I tried using this but it doesn't work.
if(_root.newsbox.textfields.news2 eq ""){
_root.newsbox.textfields.gotoAndPlay("start");
}
you cant just reference the text box itself, as that is an object and if it exisits at all it is not null. You have to actually reference the string wich holds the contents of the text box, as this is only one of the many attributes a given text box object has
okay, I have attached a zip file with the .txt that only has 2 variables with text in them. You'll see that it gets to the second piece of news and automatically goes back to the beginning when it should stay on it, and then jump to the beginning when it gets the third textfield because it is empty.
Have a look and thanks for all of your help so far.