This content has been marked as final. Show 5 replies
your cardTitles and descriptions arrays are declared as local variables inside your onLoad handler which means they are not available outside that function.
put these two lines:
var cardTitles:Array = new Array();
var descriptions:Array = new Array();
under this line:
var captions:Array = new Array();
Try removing the "var" declaration from the two arrays so that they are not confined to your onLoad function.
that would also work... what way you choose is simply a matter of coding style.
Many coding standards would require that you to define and initialise the variables in their correct scope. It helps with others reviewing your code if that is ever required and its also easier when you look back at it two months later and you're trying to figure out what you did (who hasn't been in that situation, lol)
I would also call the loadText function within your onLoad handler rather than assume your data will be loaded within some specified time limit you established in the setInterval. It just seems safer.
rlc5611: good point, I didn't even see that,lol