Skip to main content
Known Participant
November 20, 2012
Answered

Flash poor performance with vector art (.svg)

  • November 20, 2012
  • 1 reply
  • 935 views

When using multiple pieces of vector art I've noticed that performance gets rather sloppy, so I created a simple test program that displays 100 copies of the same graphic and allows zooming. I used what I believe to be a fairly simple vector image (can see links below). However, fps drops massively when zooming in or out. I know zooming requires a lot of calculations, but I have an above average system (i5 2500k processor) that I would expect to handle such demands. Is there something I'm missing? or is vector art just not viable for my game (I would need lots of similar artwork on the screen at one time)

Picture of image - http://i.imgur.com/Cj50O.png

SVG file - http://pastebin.com/MjBLebFQ

Test Code: http://pastebin.com/Xmquy9Py

This topic has been closed for replies.
Correct answer kglad

for optimum performance you should use bitmaps (or enable cacheAsBitmap).  but if you're doing a lot of zooming that won't work unless you're publishing for a mobile and can use the cacheAsBitmapMatrix property.

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
November 21, 2012

for optimum performance you should use bitmaps (or enable cacheAsBitmap).  but if you're doing a lot of zooming that won't work unless you're publishing for a mobile and can use the cacheAsBitmapMatrix property.

Wozza12Author
Known Participant
November 21, 2012

Oh wow, cache as bitmap seems to make quite a noticable improvement in performance. I didn't know that option was possible.

I will look into bitmaps, but I tried before and noticed the quality was poor when zooming. Lots of jagged edges. I tried using bitmapSmoothing but then my images were noticably blurry afterwards.

Thanks for the help again kglad. You are an absolute legend!

kglad
Community Expert
Community Expert
November 21, 2012

you're welcome.

if you're publishing for mobiles and can use cacheAsBitmapMatrix, you can import (or create) the highest zoomed bitmap you will need.  then you won't have a problem with quality when zooming down.  you will be consuming more memory so there are limitations on using bitmaps with zooming for mobiles.