Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems w/ printJob printing movie clips in other frames

Status
Not open for further replies.

clemrock

Programmer
Joined
May 20, 2004
Messages
118
Location
US
Hello,

I have a little function that I'm calling from a button that prints the contents of a movie clip.

I would like to also print another frame that's not the current visible frame.


Here's my function:

function print_movie_contents( print_page )
{
var my_pj:PrintJob = new PrintJob();
var myResult:Boolean = my_pj.start();

if( myResult)
{
my_pj.addPage( print_page );
my_pj.send();
}

delete my_pj;

}//__endFunc__



Is this possible in any way?

Thanks,
Clem C
 
Yes. [tt]addPage()[/tt] takes a frame number to print as a parameter, and the frame to print doesn't have to be currently visible at all.

For example, this modified function now takes 2 parameters - the target MovieClip and the frame number to print:
[tt]//
function print_movie_contents(argTarget:Object, argFrameNum:Number) {
var my_pj:PrintJob = new PrintJob();
var myResult:Boolean = my_pj.start();
if (myResult) {
var printArea:Object = {xMin:0, xMax:320, yMin:0, yMax:240};
var printOption:Object = {printAsBitmap:false};
if (my_pj.addPage(argTarget, printArea, printOption, argFrameNum)) {
my_pj.send();
}
}
delete my_pj;
}
//[/tt]

If you want to print, say, the frame 6 of the MovieClip [tt]mcX[/tt], you will call the function:
[tt]//
print_movie_contents(mcX, 6);
//[/tt]

The above script is set to print 320 x 240 area in vector. Adjust those to suit your needs (or you can pass them as parameters.)

Kenneth Kawamoto
 
Wow - this is awesome. Everything I've read says you couldn't print any frame but the current frame.

You proved them wrong.

Thanks!

Clem C
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top