A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [CS3][AS2]Mysterious Performance Issue

  1. #1
    Senior Member
    Join Date
    Jul 2006
    Location
    United States of Dorkslvania
    Posts
    103

    Unhappy [CS3][AS2]Mysterious Performance Issue

    ‘Sup, folx.
    Me and my friend have been struggling with a nasty memory leak/waste problem in flash.
    There’s a movie clip in the library that contains a bunch of functions. It basically loads an external XML containing a list of URL paths for a bunch of thumbnail movie clips to load external JPEGs from.
    The idea is to change the thumbnail gallery depending on which button in the menu is pressed. So when you click on a button, that movie clip (containing the thumbnail function) is removed and then attached from the library again and fed the XML path based on the selection from the menu.
    For some reason, with EVERY time that movie clip is removed, and re-attached, the performance of the Flash takes a major hit and the frame rate drops visibly and things get progressively worse. It almost feels as if the variables that are loaded into the MC attached from the library are still somewhere in the memory even after the MC is destroyed. Also, despite the fact that it loads a total of no more than a couple of different XMLs, it slows down as if each time it loads a new XML and a set of new thumbnail images every time. What the…
    Is this a scoping issue? What the hell is this?
    Can anyone please suggest something? We’ve been pulling our hair over this for weeks and the production deadline is nearing.
    Thank you for any help.


    WindowsXP SP2 Flash CS3 Pro, Actionscript 2.0

  2. #2
    ___________________
    Join Date
    May 2004
    Posts
    3,174
    without seeing the actual code/fla i can't be sure, but a quick primer on scope and garbage collection:

    1. you can see what's floating around if you do test movie then debug > list variables. IMHO, there should be none.

    2. variables are local when declared with "var" inside a function. local variables should be used in EVERY case where possible.

    3. flash does a great job of garbage collection. basically, once there's no possibility of a reference to a variable, it's removed from memory. this is usually the case with local variables (see #2), and seldom the case with global ones.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center