Thank you Jerome and Michael; really good info and it does help clear things up .I will look into and read up on them more as i progress in my away3D project. In my project i recreated the HoverCamera3D functionality using Camera3D and working on implementing the ability to pan and zoom in on the scene at the mouse coordinates. But i do and will have a lot of objects on stage, so potentially many events to listen for. So far i have 1261 face objects on stage and later a few dozen 3DS models....
Thanks again guys, always great to learn new things..... :) On May 10, 9:58 am, elguapoloco <[email protected]> wrote: > Hi CyberHawk, > > If you do not remove the event listeners on an object it will not be > Garbage Collected and will remain in memory. That means that an > ENTER_FRAME handler will keep running. That can affect the memory but > also performance of your app. Obviously for persistent interactions > (like keys) on the stage you don't need to remove them unless you > don't need them anymore. But when you have objects that you plan on > creating and removing dynamically (like containers for sections on a > site or images in a carousel) you should build a way to remove all the > events once you are disposing of that object. You can just add 2 > functions to classes that will handle this addAllEvents() and > removeAllEvents(). Just make sure all the events added in addAllEvents > are removed in removeAllEvents. > > But the best way to handle this is to avoid creating garbage in the > first place! Use Object Pools where ever possible. Google it, there > are vary simple implementations you can apply to your projects. By > recycling your objects, like those using BitmapMaterials, you can save > yourself a lot of hair lost in debugging memory issues :) > > The HYPE framework has a lot of Object Pools demo and Lost In > Actionscript has a Basic Object Pool class in its repository. > > ath. > > Jerome.
