Forgive the cross-post, but I posted the question on a couple of lists
yesterday, so I'm posting my solution today.

I was having memory problems because I was loading all my assets
dynamically, through code, not in the score. Cast and score memory kept
creeping up, and I couldn't get Director to release the cast members.

Cole Tierney set me on the right track. He suggested I temporarily
"unplug" my linked casts. That did the trick.

I created a dummy cast with nothing in it, and every time I go to a new
activity, I call this:

on mUnloadMembers me
  if pMemberList.count > 0 then
    repeat with i = 1 to pMemberList.count
      pMemberList[i].unload()
    end repeat
    
    repeat with i = 2 to 7 -- 1 is internal
      fName = the fileName of castLib i
      the fileName of castLib i = the moviePath & "dummy"
      the fileName of castLib i = fName
    end repeat
  end if
  
  pMemberList = []
  
end unloadMembers

There's some other stuff I have to do--I have to take a snapshot of the
stage and put it on stage while I'm resetting the casts. Otherwise stuff
disappears and reappears as the casts are reset.

That's basically the solution, short of going to a new movie and back
(that would have been a major rewrite).

Cordially,

Kerry Thompson


[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to