If you use the AwayStats (or Mr. Doob's stats) you will be able to monitor
memory use in your app. Your memory is probably rising on the creation of
each object until it reaches a critical state and crashes your app. You need
to properly release the memory used for an object when you remove it. This
could be probably done by properly destroying the removed objects and
removing any reference that exists to them. Only in this case will Flash's
garbage collector properly renew the memory used for this object. I'm sure
someone could be more precise about this topic and explain it better to you,
but I'm pretty sure you are having a memory management issue.

It might also be a good idea to reuse objects and have a limit of objects
that can appear at the same time. For example, suppose you choose a max. of
100 objects that can appear at the same time. You initially create these 100
objects and then select which come in and which go out. When an object goes
out of the scene, you have it available for reuse and no one needs to know
it is the same object.

AwayStats will help you see if you solved your problem or not.

hth!

Reply via email to