PDA

View Full Version : how to cut the fat off library symbols


that1guy
02-05-2009, 03:09 AM
Say I create a library symbol with only one frame, and I do not want to instantiate the symbol with actionscript. How do I reduce its overhead as much as possible? In the symbol properties dialogue box, should I

A) select Type: Graphic

B) select Type: MovieClip and leave Export for ActionScript unchecked

C) select Type: MovieClip and check Export for ActionScript, and set
Class: SomeClassName
Base class: flash.display.Sprite

What is best for framerate?
What is best for memory usage?

What happens to a symbol with Type: Graphic when the swf compiles? There's no corresponding AS3 class. Does a graphic get its own timeline?

What happens to a symbol with Type: MovieClip (and Export unchecked) if it only has one frame when the swf compiles? Does it still get a timeline?

A symbol with Type: MovieClip and Export checked with
Class: SomeClassName
Base class: flash.display.Sprite

apparently becomes a dynamic subclass of Sprite called SomeClassName. This sounds to me like the least overhead, because a Sprite does not have a timeline. However, the subclass is dynamic, and it's also being exported for actionscript when it doesn't need to be. Is this really the best way?

ASWC
02-05-2009, 05:45 AM
What is best for framerate?
What is best for memory usage?

Technical answer: Library symbols have no influence on framerate and memory usage unless you use them.
Pragmatical answer: it depends.

that1guy
02-05-2009, 08:59 AM
Useful answer: ?
Answer answer (as opposed to non-answer): ?

daveystew
02-05-2009, 11:13 AM
Any particular reason you're asking? It might let people provide better answers :)

that1guy
02-05-2009, 06:59 PM
Well, I've created a library symbol with only one frame, and I do not want to instantiate the symbol with actionscript. But I do want to create a large number of simultaneous instances of the symbol using flash cs3, and also instances of other, multi-frame, animated MovieClips. So flash player will be under a heavy load, and I'd like to know which (if any) of the 3 options I mentioned above are best for framerate - concerning the single-frame symbol. For the reasons I've outlined, option C sounds the best to me, but I can also imagine how A or B might be best.

ASWC
02-05-2009, 07:56 PM
I don't think you'll see any difference with any of your 3 choices.

flashkeith
02-05-2009, 08:04 PM
It also depends if they're going to be InteractiveObjects or not. Check out the Help for "Core display classes", it has a nice hierarchy. It sounds like a Graphic is enough, but I don't know if you plan on manipulating the image or interacting with it. A Sprite is a safe bet if you want interaction and there is only one frame.