Skip to content
This repository has been archived by the owner on May 15, 2022. It is now read-only.

Shape Export to FXG

claus edited this page Aug 13, 2010 · 3 revisions

With as3swf you can generate FXG from SWF Shapes, to reuse those shapes in your Flex 4 projects or with various other Adobe tools.


Example

The following code exports a SWF shape to FXG:

// Parse the SWF contained in ByteArray ba
var swf:SWF = new SWF(ba);
// Grab a DefineShape tag from the internal dictionary
// We assume here that character ID 1 represents a shape tag
var shape:TagDefineShape = swf.getTagByCharacterId(1) as TagDefineShape;
// Export the shape to FXG
var doc:FXGShapeExporter = new FXGShapeExporter(swf);
shape.export(doc);
// Dump the generated FXG
trace(doc.fxg.toXMLString());

This is the FXG of an example rectangular shape with a linear gradient stroke and a radial gradient fill, exported by as3swf:

Clone this wiki locally