views:

114

answers:

1

Just curious to know if empty movie clips or sprite can slow down a application or game. Reason being is because I want to use multiple sprites as containers for my object. So I can easy manage what objects are in front of others. Some points in the game, layers will be empty so I am just curious if I should just make those layers null if they arent being used or will that even make a big difference. thanks!

+1  A: 

Yes! Every object you create ultimately requires some resources. But you're going to have to create quite a few before you run into any problems. Odds are, you don't have to worry about it. (in this case)

It's always a good idea to remove any objects you are done with, but the new key word is really expensive, so if you know you are going to need an object again soon, just hold on to it. Especially something small like an empty Sprite.

Tyler Egeto
And in addition to that just try to remove event-listeners if there are any.
bhups
are you saying that just initializing a new class takes a tole on performance
numerical25
Yes, if you say 'new' there is a bunch of stuff going on in the background. Every action requires some resources, whether it be math equations, screen rendering, or function calls. When you use 'new' there is object instantiation, memory allocation (reserving resources for that object), etc. Remember the Flash Player is an application, so it's running on code too. It needs to process everything you throw at it.
Tyler Egeto