Some VERY basic questions below, but I'd like to check my understanding of scenemanager as I'm having a memory problem when changing scenes repeatedly with something I'm coding and it eventually cripples its performance. I'm very much a suck it and see hobby programmer and so my descriptions will be very non-technical I'm afraid.
I've sort of assumed that:
(1) If graphics and text are added using self rather than stage, then when the scene changes they will automatically be removed without me doing anything else.
(2) If I add an eventListener to a display object, then the listener will be removed when the object is.
Is that correct or will those leave something in memory?
Also, if I have tables of data in a scene, do those need to be cleared in any way? And what about sounds?
As a test, I've built by a simple thing that has almost identical code in two scenes and uses identical assets. Each scene has the option to either go to the other scene (e.g. scene1 to scene2) or to refresh itself by using scenemanager to go to itself again (e.g. scene1 to scene1). I'm using collectgarbage("count") to print out the memory use as each transition is completed.
I have found that whenever I go from a scene to itself (e.g. scene1 to scene1) the memory use stays pretty well constant. But, whenever I go back and forward between the two scenes, the memory use gradually increases. I've tried adding an enterFrame collectgarbage function and that made no difference. I've tried removing listeners as the transition is initiated and that made no difference! And I think it's the same problem that I'm experiencing in the proper app I'm coding.
Sorry for the long post, but any ideas welcomed!