TwelvestoneFlash

Print Class printjob.addPage


Sign in

  • Waiting for Godot ( 720 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 4.8 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.8 k posts )
    general front end design an...
  • Back End ( 9.6 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
Big Ern
 
2008-06-20

myPrintJob.addPage(this._parent.mcFlashMovie.mcPrint, {xMin:0,xMax:600,yMin:0,yMax:850}, {printAsBitmap:false}, 1);

In the code above, according to the flash docs, I have to put "this._parent.mcFlashMovie.mcPrint" in quotes, but it won't find it if the mc I want to print is not on the root level.

If I put the path in there without the quotes, it doesn't print the movieclip either.

How do I get around this?

JLM
 
2008-06-20

Have you tried something like

var par: String = String( this._parent.toString() ); var path: String = par+'.mcFlashMovie.mcPrint'; myPrintJob.addPage( path, { xMin: 0, xMax: 600, yMin: 0, yMax: 850 }, {printAsBitmap: false}, 1);

Big Ern
 
2008-06-20

tried it and I also moved everything out so it's on the root, like so:

var myPrintJob:PrintJob;

mcEndElements.btnPrint.onRelease = function(){

myPrintJob = new PrintJob();

var myResult:Boolean = myPrintJob.start();

if (myResult){
    printPage();

}else{
    //User does not have printer or has cancelled
    //print_txt.text = "Printing cancelled. Please try again.";
}

}

function printPage() { //add pages to print myPrintJob.addPage( "mcPrint", {xMin:0,xMax:600,yMin:0,yMax:850}, {printAsBitmap:false}, 1);

myPrintJob.send();

delete myPrintJob;

}

mcPrint is located off the stage.

this prints fine when I run it directly, but I want to load it into a container swf. When I run the swf directly and click the btnPrint, it works but when I hit btnPrint once the swf has been loaded into the container swf it prints a blank page (when I trace mcPrint, it finds it)

...and here's the really weird part, IF I drag mcPrint onto the stage, it prints fine from the container swf. Why would that work?!

Do you know what I mean...

Big Ern
 
2008-06-20

nm - There was a mask on the container swf.

Fucking hell, I swear I'm not trying to waste people's time in this forum on purpose.

Sorry JLM, I hope these last two bonehead flash posts I've started won't stop you from helping me in future! k

JLM
 
2008-06-20

Don't worry I do that all the time. Atleast I followed your question, not like the one storm answered from new barrel fodder, I still don't get it.

Storm
 
2008-06-20

stop dragging me into your threads!! k)

We all do things like this ewf.

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

Print Class printjob.addPage