22 Replies Latest reply on May 31, 2007 9:31 PM by kglad

    Movieclips loaded with attachMovie may need to be removed

    stanbridgethegreat Level 1
      I have a flash page with a menu down the left and have it so that when you click a button on the menu, it plays the relevant movieclip in the main section via a dynamic movieclip container using attachMovie. Each time a new "section" movieclip is loaded, I want it to transition from one section-clip to the next using the "transition_mc" movieclip mask.

      To make everything clearer, I've recreated a watered down copy of the whole movie containing just the "section movieclips", the dynamic movieclip loader (using attachMovie) and the transition mask (and of course the relevant bits & pieces for each)

      Click here to download the clip...

      In this sample, only the "Current Projects" button and the "Development Opportunities" button have the transition working.

      The problem is that after switching back and forth between these two sections for a while, the whole Flash doc seems to get slower and slower.

      My guess is that each "section movieclip" is not being removed and so each time it's clicked it loads another copy into memory. Thus, the more times clicked, the more memory used, the slower everything goes. The section clips underneath are very small at the moment so it takes a few clicks between each to get it all to start slowing down (on my system anyway). I think I'll need to fix this sooner rather than later as when finished, each "section movieclip" will be a bit larger and it won't take much at all to make things run slow!

      If you look in the actions for "DYNAMICCONTENT-mc" you'll see that I have commented out a line of code showing a remnant of my initial attempt to fix this.

      Can anybody show me what I need to do to remedy this problem? Any help is very much appreciated!