# AS3 conclusion: dynamic things are evil

**URL:** <https://forum.kirupa.com/t/as3-conclusion-dynamic-things-are-evil/225529>\
**Category:** flash\
**Created:** [May 13, 2007, 11:36am UTC](https://forum.kirupa.com/t/as3-conclusion-dynamic-things-are-evil/225529 "2007-05-13T11:36:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aquilonian](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@Aquilonian](https://forum.kirupa.com/u/Aquilonian)\
**Post date:** [May 13, 2007, 11:36am UTC](https://forum.kirupa.com/t/as3-conclusion-dynamic-things-are-evil/225529/1 "2007-05-13T11:36:18Z")

</div>

Cos 1: Slow  
2: Have to keep track of all references to it to completely remove it from memory, SO, when you have, for example, a game and have to fire many bullets, and  
In the old AS2 way you would create new MovieClips for all bullets and remove those later, in AS3 creating those clips would create a memory problem later, if you dont know were are all the references for it  
SO, whats the way to solve this, i dont know, what i am thinking is a way to avoid this, and the way i think in avoid this is the following: instead of create and remove lots of new blebleble, create in the beginning all the maximum amount of blebleble that will be visible on the screem and put them in a array and give a property ‘available’ for each one, and when is time to use some, instead of dynamically create new bebleble you go to the array, loop on it looking for the first available and use it, when its time to remove you make it unavailable, so it will wait to be reused  
As i plan to do this many times i am making a class to control all of this, it will have two array of propertyes, one to put in each blebleble when is time to ‘activate’ it and the other to put when is time to ‘unactivate’ it  
What do you think, does it make sense?
