So I have an app that embeds swf's for icons in each sprite, where each swf is between 2kb and 8kb in size (SEE ATTACHED IMAGE). I am using swf's, as opposed to pngs, as the app scales and I want the icons to remain perfect at any zoom level. Their can be up to 1500 sprites in app at one time, possibly looking at 4000 in the future.
I am embedding the swfs like so: Embed('assets/images/wap.swf');
The problem is at about 600 sprites the app freezes up the CPU. I have tried setting cacheAsBitmap to both true and false and neither helps or hurts much. If I take out the swf icons and just use a circle in the graphics layer of each sprite the app runs perfectly no matter how many sprites I add.
I was wondering if anyone had any suggestions.
I thought about adding and removing the icons from the sprites if the sprites were off the screen and add them back if/when they viewable on the stage. But I am not sure one how to achieve this making each sprite aware if its on or off the screen and two would adding and removing the nodes be fast enough so the eye cant see it and would adding and removing the nodes so quickly be just as much CPU drain as leaving them visible all the time?
It is hard to determine without seeing how you embed the swfs what is happening(are they embedded as classes or embedded as images), Try this load a swf into an image and then check the bitmapdata size this I think is your problem, displayable size is much bigger than vector size but it sounds like you aren't using vector graphics and if this is the case then scaling the size of the sprite is still going to pixelate your display image.
Using classe as:
_imgClass = dict['iconname'];
_image = new _imgClass();