CrappyFlexPrintJob.as

The prinjob class [very straight forward]- it was more to keep out clutter code:

package com.ericmcconkie
{
import flash.events.EventDispatcher;
import mx.printing.FlexPrintJob;
import mx.printing.FlexPrintJobScaleType;</code>
 
<code>public class CrappyFlexPrintJob extends  EventDispatcher
{
private var que:Array;
public function CrappyFlexPrintJob(printJobQue:Array)
{
super();
que=printJobQue;
 
var printJob:FlexPrintJob= new FlexPrintJob()
// Start the print job.
if (printJob.start() != true) return;
printJob.printAsBitmap=true
 
// Add the object to print. Do not scale it.
for(var b:int=0;b
{
printJob.addObject(que[b], FlexPrintJobScaleType.SHOW_ALL);
}
// Send the job to the printer.
printJob.send();
 
//dispatch event that we are ready to clean up or move on
dispatchEvent(new CrappyFlexPrintJobEvent(CrappyFlexPrintJobEvent.DONE,0))
}
}
}

And it’s cousin – The Event subclass:

package com.ericmcconkiegroup
{
import flash.events.Event;
 
public class CrappyFlexPrintJobEvent extends Event
{
public static const PRINT_PAGES:String='printPages';
public  var pageNum:Number;
public function CrappyFlexPrintJobEvent(type:String,_num:Number, bubbles:Boolean=false, cancelable:Boolean=false)
{
super(type, bubbles, cancelable);
pageNum=_num;
}
public override function clone():Event
{
return new CrappyFlexPrintJobEvent(type,pageNum,bubbles,cancelable)
}
}
}