This content has been marked as final. Show 8 replies
I haven't looked in depth at your code, but if it looks like it calls
loadInfo(0,undefined) every 1 second.
ctotal is not defined until the xml has loaded
And *I think* (not 100% sure, I'll do quick test now) that these arguments in the setInterval call will be by value and not reference.... so they won't change from the first call. Please others correct me if I'm wrong on this.
huh... okay, so should i be calling the setInterval within the loadXML function where ctotal is being defined? and if the parameters are recognized as a set value rather than a reference to an every changing value, how should i deal with this? would updateAfterEvent do anything for me?
yes you should call setInterval from inside your loadXML function...updateAfterEvent is not relevant here. I'm just taking a look at the other part... I'm guessing its just best to access the current values from inside your loadInfo function. Will answer shortly
If your setInterval depends on the data from the xml file then you need to wait for it to load. Call the loadInfo from inside the loadXML function.
I can't see you using the 'm' argument in any case..
So why not just change all the 't' to (ctotal-1) inside your loadInfo function.
and remove the aguments m and t from the function?
ps. a quick way to do that is:
var t = (ctotal-1) ;
and leave the rest as it was
okay, i was using the argument m, b/c when i left it with out m and just used p it wasn't incrementing for some reason...
okay, so now everything is set! thanks guys for helping me out... every thing worked out with taking away the arguments in the function and putting the setInterval within the XML loading function.
take it easy :0)
cheers... you're welcome.