;

PDA

Click to See Complete Forum and Search --> : Printing to a Printer


webtech2000
11-25-2007, 10:01 PM
Hi all,

Re: Action script.
I am trying to create a “print” button to print a screen page displayed with my standalone flash player. I have set up a short test for the user and would like them to be able to print their final score results including some graphics “like a certificate with score results.

If anyone has a little working sample, that would help me a lot.

Thanx heaps

Clive

blanius
11-25-2007, 11:36 PM
Simplest thing is to do this on button to print mc1
my_pj= new PrintJob();
my_pj.start()
my_pj.addPage("mc1");
my_pj.send()
delete my_pj

You can add pages and you can also do compete error checking that I've not shown here. This will print out everything in a clip named mc1. You can supply any clip and even set what portion of it you want to print.

You should check out the docs at
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/js/html/wwhelp.htm?href=Part4_ASLR2.html

webtech2000
11-26-2007, 12:40 AM
Thanx blanius :) ,

I will give it a test.

Thanx again

Clive

kingkelly
11-29-2007, 05:09 PM
What if i have a bunch of movieclips on top of each other in an area of my swf? And i wanted to print that whole area, not just an individual MC?

blanius
11-29-2007, 08:29 PM
You print the _root movie and set the area
See the link above:

addPage(target:Object, [printArea:Object], [options:Object], [frameNum:Number])

If you passed a value for printArea, the xMin and yMin coordinates map to the upper left corner (0,0 coordinates) of the printable area on the page. The user's printable area is described by the read-only pageHeight and pageWidth properties set by PrintJob.start(). Because the printout aligns with the upper left corner of the printable area on the page, the printout is clipped to the right and/or bottom if the area defined in printArea is bigger than the printable area on the page. If you haven't passed a value for printArea and the Stage is larger than the printable area, the same type of clipping takes place.

jessicacrandall
12-05-2007, 06:05 PM
This pj function will only output in Flash player seven or higher, right?

I have a movie in flash player 6 I am trying to get to print. Do you know anything about printAsBitmap() function?