Author Topic: performance and swf's  (Read 1267 times)

Max

  • Newbie
  • *
  • Posts: 13
performance and swf's
« on: February 13, 2009, 04:32:06 PM »
I was wondering if you(florian) have done some test regarding to swf's and how this affects performance. Im building a dynamic magazine atm, and ive noticed a pretty drastic drop of FPS and im only at a few swf pages. Already tried removing all the code but this didnt make any difference, theres stil alot of stuff i can check so maybe its just me doing something wrong.

Anyhow, id still like to know to what extend certain aspects(textfields/bitmaps/shape animations etc) of normal animated swf's or interactive swf's affect the fps.

The previous component we used was AS2 flippingbook component, worked fine i guess but theres just to many downsides to using AS2 nowadays and id suspect any new AS3 version should be alot faster. With the old component i noticed it was faster when i just made everything bitmaps with small animations, rather then putting everything in an swf as a composition(multiple bitmaps and textfields). If this is still the case then i have no choice but to try make stuff more static and less dynamic, because the goal of my project was to make a very dynamic magazine which could be controlled from an CMS.

Florian Nücke

  • κρύα πόδια
  • Administrator
  • Hero Member
  • *****
  • Posts: 1413
  • MegaZine3 Developer
    • MegaZine3
Re: performance and swf's
« Reply #1 on: February 15, 2009, 12:18:01 PM »
Dynamic swfs are still a major slow down, because all that animation has to be pushed through a transformation matrix again to get the actual position page turn effect, so the more single elements there are, the slower it gets (that's why videos are still ok [slow it down a tad, but ok], because they are in fact one big bitmap, that just gets updated rapidly).

Even "static" swfs with just loads of vector graphics have the same problem (vector graphics are worse than bitmaps for performance, because they actually have to be rendered first). For those (e.g. for swfs generated from pdfs) there is a parameter named static which causes the whole swf to be captured as a bitmap once, and then that bitmap is used, speeding things up to a normal level.

What I have been thinking of to improve the problems with dynamic content / vector graphics was this: create snapshots of the pages once turning begins and use those for the duration of the turn. This might cause a short "lag" before the turn, but the turning performance should profit tremendously. If you have any ideas feel free to share ;)
For the Snark was a Boojum, you see.

Before you ask a question
          After you get an answer
  • please document your problem with the answer in the Project Wiki. (e.g. in the FAQs)
  • help others out if you can, by answering their questions on the forum.

Max

  • Newbie
  • *
  • Posts: 13
Re: performance and swf's
« Reply #2 on: February 16, 2009, 07:38:42 AM »
One of the solutions we always used was to make swf's and just put some basic graphics on the first frame and the interactivity and rest of the content on the second frame, and switch accordingly to which page was focused. This seemed to help and is basically the same idea as you have i guess. Ive been thinking myself if it wouldnt be easier to just put pages that cant be seen on visible = false. You could always use an offset to set pages to visible= true if youre flipping more then one page at the time. Though this will probably still slow down the whole thing if you went from first page to last page, in that case your solution might be best.