|
Project Information
Featured
Links
|
'hXgraphix saves your lineTo's and beginFill's in swf format.'
Example(AS3):
package
{
import HxGraphix;
import flash.display.*;
import flash.net.*;
import flash.utils.*;
public class Main extends Sprite
{
var _graphics:HxGraphix;
public function Main()
{
_graphics = new HxGraphix();
_graphics.lineStyle(3, 0x000000);
_graphics.beginFill(0xff0000, 1);
_graphics.drawRect(10,10,100,100);
var swf = _graphics.getSWF();
var bytes:ByteArray = swf.getData();
//Save it as swf: (FP10)
new FileReference().save(bytes, 'test.swf');
//Display it:
var loader:Loader=new Loader();
loader.loadBytes(bytes);
addChild(loader);
}
}
}
(More examples can be found in the downloads directory) |