This content has been marked as final. Show 5 replies
you're more likely to receive help if you pinpoint the location of the problem code.
That's fair enough, Kglad... I've detected that the problem was within the makecalendar() function, because I was trying to distinguish which days had news items at the same time i was duplicating the day movieclips. This was solved by doing that job within the xml loading function descodificanews.
Now my problem lies in the process of reading the news content corresponding to any highlighted day. I can detect the movieclip instance I'm clicking on, but i can't match it to the corresponding day...
I'm trying to do this where I've commented "news button control", inside the "descodificanews" function.. Many thanks in advance.
_root["dot"+s] doesn't know it has any relationship to the number i after your for-loop advances. in particular, when _root["dot"+s] is released i will be the last value of your for-loop.
to remedy, use a variable that store the value of i when _root["dot"+s] is created:
_root["dot"+s].ivar = i;
and use this.ivar instead of i in your onRelease handler.
Thanks for the contribution, klad. I've tried that now, with different variations, and came back to your tip.
I wasted some time because initially i didn't record this new ivar INSIDE the if clause where i checked which day corresponded to a news item. Consequently, the number i got was always the last one (which counts the number of news items in the xml).
A day later, and a night well-slept, it came to me.
Thanks again, you're the man!