views:

803

answers:

3

Hi,

I'm trying to use an SVG file in my Flex app - but it seems the best way to do that is to convert it to MXML. However, I cannot find an SVG to MXML converter. There seem to be a number of SVG to XAML converters (for Silverlight/C#), but I can't find anything analogous for Flash/Flex.

Any help would be appreciated.

Thanks, Karthik

+3  A: 

You should be able to Embed the SVG directly, without a converter.

Osman
I have embedded SVG files in this way with great success -- it's definitely the right answer. +1. It should be noted however, that as of the last time I tried this, you cannot load SVG images dynamically at run time; they must be embedded at compile time.
rmeador
Flex converts it for you using Batik, then embeds it.
jedierikb
+1  A: 

Well, the SVG is an XML file, basically. So if you want to import it at runtime, you could read it as an XML file and then use the AS3 drawing API to render it. Check out this ActionScript 3 SVG renderer on Google Code!

evilpenguin
+2  A: 

yes, there are few libraries but i haven't come across any mature one- - http://code.google.com/p/as3svgrendererlib/ - http://www.degrafa.org/ - http://code.google.com/p/svg-viewer/ - http://labs.zavoo.com/?p=65

Harit K