An AS3 SVG Renderer for Flash Player.
It parses and translates svg elements to Flash display objects. Rendering it and letting you interact with the output.
Requirements:
Features:
Missing features:
The library has display classes that represents each SVG element.
The SVGDocument class is the class responsible to hold the SVG display object tree.
The library has an asynchronously parser that processes the SVG file and create all necessary display objects.
You can listen to the RENDERED event to know when graphics was completely rendered for the first time.
The first thing you have to do is initialize the ProcessExecutor, that class is responsible to distribute the library processing between frames, that way the application will not get frozen while showing large SVG files. You have to do that only once in the whole application.
ProcessExecutor.instance.initialize(stage);
Now you can load any SVG file into the SVGDocument using the load method.
var svg:SVGDocument = new SVGDocument();
svg.load(urlStringOrUrlRequest);
addChild(svg);
Or if you already have the svg content string, use the parse method of SVGDocument class.
var svg:SVGDocument = new SVGDocument();
svg.parse(myLoadedSVGString);
addChild(svg);
You can also pass an XML object to the parse method, but it isn't recommended since when the parse method gets a string it does extra things to better parse the string.
Just add the SVG component to your MXML, and set the property "Source" on the component with:
Done :-). The SVG file will appear on the screen.
Licensed under the MIT License.
http://opensource.org/licenses/mit-license.php