I am creating a remote presentation tool in AS3. In a nutshell, one user (presenter) has access to the “table of contents” HTML page with links for each slide in the presentation, and any number of viewers can watch the presentation on another page, which, in turn, is in the SWF form, which polls the server every second to make sure he is on the right slide. Whenever an administrator clicks on a slide link in TOC, the database is updated, and in the next request, the swf presentation compares the label of the currently displayed slide with the response received from the server. If the response is different from the current label, swf will hide in the timeline until it finds the desired frame label; otherwise, he does nothing and waits for the next poll result (in a second).
Each slide consists of a movie clip with its own nested timeline, which loops while the slide is displayed. There are no actionscript to control any nested movie clips, and there are no actions on the main timeline except stop();on each key frame (each of which is a slide in the presentation).
Everything is built and working perfectly. The only thing that worries is that if the swf presentation is open long enough (say, 20 minutes), the survey begins to have a noticeable effect on the frame rate of the movie clips animation on any slide. That is, every second there is a noticeable decrease in the animation frame rate, which lasts about three tenths of a second, which is quite noticeable (and, therefore, a gap for the entire package of presentations!).
I know that AS3 has problems with memory management, and I tried to be diligent in reusing objects and event listeners. The code itself is simple; there is an instance Timerthat fires every second that starts new URLRequestto load URLLoader. URLLoaderreused from call to call, but URLRequestnot (it needs to be initialized each time with a new value for caching received from call to new Date().time). The only objects created in the whole class, are Timer, URLLoadervarious URLRequests(which must be collected by the garbage), but only those who are listening for the event are on Timer(added once)URLLoader (added once) and in routines that are flipped back and forth in the timeline to find the correct slide (and they are deleted after the correct slide is found).
I used the mr doob stats package to monitor memory usage, which definitely grows over time, so there should be a leak (it grows from ~ 30 MB initially to> 200 MB after some cleaning and about 25 minutes of uptime).
Does anyone have any ideas on what might cause performance issues?
UPDATE: , ; swf 15 , 70 ( ), , ( Firebug Net). ?