I solved this by adding a cretionComplete event listener to the canvas object. This fired another function that did the printing.
Giles Roadnight From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Giles Roadnight Sent: 09 March 2007 10:04 To: [email protected] Subject: [flexcoders] FlexPrintJob problem Hi I am trying to print a list of ID's from a canvas. I have the following code: private function printMovies(e:Event):void { var printJob:FlexPrintJob = new FlexPrintJob(); if(printJob.start()){ var printCanvas:Canvas = new Canvas(); var txtApprovedList:Text = new Text(); txtApprovedList.width = printJob.pageWidth; txtApprovedList.text = "textstring"; <code for generating string> printCanvas.addChild(txtApprovedList); printCanvas.setStyle("backgroundColor",0xFFFFFF); this.parentApplication.MainPanel.addChild(printCanvas); //just so I can see it renders OK, will be removed printJob.addObject(printCanvas); printJob.send(); } } With the last 2 lines commented out I get the print dialogue then when I click print the canvas appears with the text in. With the last 2 lines not commented out I get the print dialogue but when I hit print nothing happens, no canvas or text appears and nothing prints. This code does work if I just add the Text Object (not the canvas) to print but then the text has a grey background. What am I doing wrong? Thanks. Giles Roadnight
<<attachment: image001.jpg>>
<<attachment: image002.jpg>>

