2 Replies Latest reply on Oct 14, 2009 8:56 AM by flairjax

    Swf vs. PNG files size CPU crashing.

    flairjax Level 1

      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?

       

       

      TIA, J