SVG Embedding again
Monday, October 23rd, 2006 | Author: dehash
I got some useful feedback at Flashcoders about my SVG post below. So far from what I found there is no golden rule for predicting filesize when embedding svgs except that usually the swf will be smaller.
I tried some of the suggested Inkscape optimising tips (ungroup,convert to paths, removing metadata/gradient definitions) and others (Vacuum Defs, Paths simplify) but none had a notable filesize impact once that particular svg was embedded in Flash (although they do benefit other svgs).
The main culprit seems to be the three shadows below the base and one once they were removed from the svg took the resulting swf from 63k down to 30k which is roughly the svg/swf ratio I would expect.
Below left is the original monitor and the edited one one on the right, those shadows below the base add 33k (over half of the total).
One related thing I found is :
Original monitor svg = 64k adds 63k to the swf when embedded alone
Edited monitor svg = 69k adds 30k to the swf when embedded alone
Embedding BOTH svg files in the SAME swf adds only 63k to the swf
I am guessing that the reason why is that when converting embedded svgs to swf the Flex2 SDK caches paths and gradients converts them to symbols in the library so that if it finds the same definition in another embedded svg it pulls it out of the library instead of recreating it. But I would need to test it some more to be sure. Cool if it is though.
Category: Code Examples, Flash, Flex SVG | Comments off


