Just looking for a little assistance, this is my last hurdle on the project I am completing and I cannot get alivePDF to run without a compiler error. Here is my AS3.
Here is my AS
import com.greensock.*;
import com.greensock.easing.*;
import PNGEncoder;
import flash.display.MovieClip;
import fl.motion.Color;
import flash.geom.ColorTransform;
import org.alivepdf.pdf.PDF;
import org.alivepdf.layout.Orientation;
import org.alivepdf.layout.Size;
import org.alivepdf.layout.Unit;
import org.alivepdf.display.Display;
import org.alivepdf.saving.Method;
import org.alivepdf.fonts.FontFamily;
import org.alivepdf.fonts.Style;
import org.alivepdf.colors.RGBColor;
// Let's limit the right click menu
stage.showDefaultContextMenu = false;
//Save Spec PDF
// we create the PDF
var szPDF:PDF = new PDF( Orientation.PORTRAIT, Unit.MM, Size.LETTER );
// we set the zoom to 100%
szPDF.setDisplayMode ( Display.REAL );
// we add a page
szPDF.addPage();
szPDF.addImage(Mc2);
generate_btn.addEventListener( MouseEvent.CLICK, generateSzPDF );
function generateSzPDF (e:MouseEvent)
{
szPDF.save( Method.REMOTE, "http://alivepdf.bytearray.org/wp-content/demos/create.php", "MySpecs.pdf" );
}
//Save Upload Png
var saveDialog:SaveDialog;
var shareBtnArray:Array = [shareBtn,emailBtn];
for (var i:uint=0; i<shareBtnArray.length; i++) {
shareBtnArray*.addEventListener(MouseEvent.ROLL_OVER, shareBtnRollover);
shareBtnArray*.addEventListener(MouseEvent.ROLL_OUT, shareBtnRollout);
shareBtnArray*.addEventListener(MouseEvent.CLICK, shareBtnCLICK);
shareBtnArray*.addEventListener(MouseEvent.MOUSE_UP, save);
shareBtnArray*.buttonMode=true;
}
function shareBtnRollover(event:MouseEvent):void {
TweenMax.to(event.target, 0.5, {glowFilter:{color:0xc0a062, alpha:1, blurX:5, blurY:5}});
}
function shareBtnRollout(event:MouseEvent):void {
TweenMax.to(event.target, 0, {glowFilter:{remove:true}});
}
function shareBtnCLICK(event:MouseEvent):void {
//Function TBD
}
shareBtn.addEventListener(MouseEvent.MOUSE_UP, save);
function export():void
{
var bmd:BitmapData = new BitmapData(612, 792);//Creates a new BitmapData with the board size
bmd.draw(Mc2);
var ba:ByteArray = PNGEncoder.encode(bmd); //Creates a ByteArray of the BitmapData, encoded as PNG
var file:FileReference = new FileReference(); // Instantiates a new File Reference Object to handle the save
file.addEventListener(Event.COMPLETE, saveSuccessful);
file.save(ba, "MyImage.png"); //Saves the ByteArray as a PNG
}
function saveSuccessful(e:Event):void
{
saveDialog = new SaveDialog();
addChild(saveDialog);
saveDialog.closeBtn.addEventListener(MouseEvent.MOUSE_UP, closeSaveDialog);
saveDialog.closeBtn.addEventListener(MouseEvent.MOUSE_OVER, closeSaveDialogRO);
saveDialog.closeBtn.addEventListener(MouseEvent.MOUSE_OUT, closeSaveDialogROut);
saveDialog.closeBtn.buttonMode=true;
}
function closeSaveDialogRO(e:MouseEvent):void
{
TweenMax.to(saveDialog.closeBtn, 1, {glowFilter:{color:0xc0a062, alpha:1, blurX:5, blurY:5, strength:1, quality:2}});
}
function closeSaveDialogROut(e:MouseEvent):void
{
TweenMax.to(saveDialog.closeBtn, 0.25, {glowFilter:{remove:true}});
}
function closeSaveDialog(e:MouseEvent):void
{
removeChild(saveDialog); //Removes the dialog of the Stage
}
function save(e:MouseEvent):void
{
export(); //Calls the export function to begin the saving process
}
stop();
Here is the compiler Error:
…/org/alivepdf/pdf/PDF.as, Line 3196 1137:Incorrect number of arguments. Expected no more than 1.
I am using vers 0.1.4.9
any help would be greatly appreciated.