this is a simple example of new feature in flash cs4 FileReference.save(). in this example i just create an html file using the rich text editor from http://mobilewish.com/applications/as3texteditor/. and save it using FileReference.save() to local file system . download rich text editor
// we create the PDF var myPDF:PDF = new PDF( Orientation.LANDSCAPE, Unit.MM, Size.A4 );
// we set the zoom to 100% myPDF.setDisplayMode ( Display.REAL );
// we add a page myPDF.addPage();
// set the line style color myPDF.lineStyle ( new RGBColor ( 0x990000 ) );
// we draw a circle //myPDF.drawCircle ( 20, 20, 20 ); myPDF.addImage(clip,0,0); // we add our second page myPDF.addPage();
// we set font and size myPDF.setFont ( FontFamily.HELVETICA, Style.NORMAL ); myPDF.setFontSize ( 16 );
// we add some text myPDF.addMultiCell ( 80, 8, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut posuere, felis volutpat hendrerit ullamcorper, purus sem vehicula augue, ac volutpat sapien dui non metus." );
// we generate the PDF when the button is clicked generate_btn.addEventListener( MouseEvent.CLICK, generatePDF );
function generatePDF ( e:MouseEvent )
{
// to save the PDF your specificy the path to the create.php script // alivepdf takes care of the rest, if you are using AIR and want to save the PDF locally just use Method.LOCAL // and save the returned bytes on the disk through the FileStream class
var bytes:ByteArray = myPDF.save(Method.LOCAL); var file:FileReference = new FileReference(); file.save(bytes,"myfile.pdf");
this is just a test i created in flash cs4 3d. I'm not sing that this flower is a beautiful one. you can download the source here.any way flash cs4 3d feature is a great one. on coming days i'm tring to do more thing in cs4 3d
Note: flash 10 player required to view this sample