I have an application that consist of a 3D view and some 2D views. The problem occurs when I try to print one of the 2D views. The 3D view is empty after the printing has been accepted by the user.
I have replicated the problem with the Basic_Load3DS example in Away 3D. I added a red button for initiating the print job. The PrintJob prints the button and has nothing to do with the 3D view but the ant disappears after the printing is done.
You have to click OK in the printing dialogue that appears for the problem to occur.
Here is the code that I added to the Basic_Load3DS example
private var _btn:Sprite;
protected function initExtra():void
{
_btn = new Sprite();
addChild(_btn);
_btn.graphics.beginFill(0xff0000);
_btn.graphics.drawRect(0, 0, 100, 100);
_btn.y = 100;
_btn.addEventListener(MouseEvent.CLICK, print);
}
protected function print(e:Event):void
{
var tPJ:PrintJob = new PrintJob();
if (tPJ.start())
{
tPJ.addPage(_btn); //This line cause the problem
tPJ.send();
}
}
Nothing goes wrong if I comment out the line
tPJ.addPage(_btn);
Any ideas on how to solve this problem? I’m in urgent need of a solution!