Instantiating an object vs. using a symbol from the Library
Posted on 2011-09-25
Hi, I'm trying to determine what would be a better course of action in terms of performance, whether to create symbols for all my visible objects in my AS3 game project or whether to instantiate them at run-time.
For example, lets say I wanted to add a ball to the stage. Would it be better in terms of performance to use a symbol object from the Library and add it to the stage, or would it be better to programmatically draw the ball, fill it with color, and add it to the stage?
It would be hard to instantiate objects like a space ship or a blast of fire and smoke, which would all be better drawn by creating the actual vector graphics, making it into a symbol and adding them to the Library, but what about primitive shapes like circle, rectangles, etc.
My main question is which of the two methods is more memory and performance effective.