Embedding a SVG file
Thursday, August 17th, 2006 | Author: dehash
SVG file drawn using Inkscape and embedded in swf at compile time. The box at bottom left had a radial gradient fill in the svg that does not appear in the swf.
SVGEmbed.as code below compiled using FlashDevelop and a Bit-101 template
Actionscript:
-
package {
-
import flash.display.Sprite;
-
public class SVGEmbed extends Sprite {
-
[Embed(source="../assets/plainsvg1.svg")]
-
private var SimpleSVG:Class;
-
-
public function SVGEmbed() {
-
init();
-
}
-
private function init():void {
-
var mySVG:Sprite = new SimpleSVG();
-
mySVG.scaleX=0.5;
-
mySVG.scaleY=0.5;
-
addChild(mySVG);
-
}
-
}
-
}



I have the same problem. Anyone know how to fix this? I want my gradients to show up in flex!
Thanks, this was just what I was looking for!