This was working before, but I must have changed something and now I can’t see what I have done.
Here is the code used to load the external txt and break it into an array.
tipSet = new LoadVars(this)
tipSet.load([modName+".txt"]);
tipSet.onLoad = function(success){
if(success){
tipsArray = new Array();
tipsArray = tipSet.tips.split(">");
setInterval(fillTip,10000);
}
}
function fillTip(){
if(i>0){
if(tipsArray!=null){
welcomeClip.nextFrame();
welcomeClip.tipText.text=tipsArray[i-1];
//tipsArray[i-1];
}}
i++;
if(i>tipsArray.length){
i=1;
}
}
The fill tip function then fills a dynamic text field with the individual tips at a rate of one per 10 seconds, or at least it should.
Here is the external txt file:
tips = tip # 1: Here is a tip. It contains a bunch of text>Tip#2: Here is another tip>Tip #3: Notice the what character seperates each tip. I hope you don’t need that character in your text.
Like I said, I had this working before. Can anyone spot the error. Right now the welcomeClip isn;t advancing becuase tipsArray = null. If I take out the if(tipsArray!=null) statement, the welcomeClip does advance but no text is shown, so it at least goes as far as calling the fillTip function, so tipSet(load) must be successful.
Thanks.
_t