PrintJob
I am currently using Flash MX 2004 to output a projector that uses the PrintJob function. I am creating a kiosk that runs off of a Mac, but when the user presses the print button the OS kicks in and the "page setup" window opens and then the "print window" opens to confirm. Is there any actionscript that can just send the print job directly to the printer - or java/applescript?
Adobe > ActionScript 1 and 2
Posted on: 07/21/2005 02:15:05 PM
View Complete Forum Thread with Replies
Sponsored Links:
Printjob
I am using the following code to print a movie. It prints fine but it seems that the print dialog comes up twice. Anyone know why this might be? This code is in the last frame of a movie clip.
Code:
printJob = new PrintJob();
if (printJob.start()){
printJob.addPage(_root.printMovie, 0, 0, 1);
printJob.send();
} else{
trace( "print start failed");
}
View Replies !
View Related
[F8] PrintJob... Please Help
i am trying to make a swf where the the user will be able to print either the page they are on, or a selection of pages, or the whole site. I've been trying to follow a tutorial but i dont really know where to put the scripts etc... sorry, i know its a big ask, but i'm really stuck. can someone help me please
View Replies !
View Related
PrintJob
Need a little help with the PrintJob function using Flash MX Pro.
I am trying to center the content of a MovieClip on the page when printing.
I have taken the pageWidth / 2 minus flashMC._width / 2 and set the flashMC._x equal to that amount... in theory that seems like it would work, however when printing the content is printed a little left of center.
Am I overlooking somthing? Any suggestions? Thanks.
View Replies !
View Related
Printjob & DPI
I would like to print my movie using the printJob class at 300dpi because it has bitmaps and looks much better when printed at 300. The problem is I want to keep my SWF at 72dpi because it runs really slow at 300. Any way I can do this? Thanks for any help on this.
View Replies !
View Related
Using PrintJob
hi I am developing a project in which I use the PrintJob to print a screen. The problem is that the impression does not fit in the paper. the format of the screen is of 1024 x 768. in axle y leaves everything, but in axle x it only leaves the half. It would like that somebody help me, therefore I know that it is a simple thing but I did not obtain to decide. I placed the code below so that all see and obtain to indicate me the error.
Code:
//var impressao:PrintJob = new PrintJob();
on (release){
var impressao:PrintJob = new PrintJob();
if (impressao.start()){
// Starting at 0,0, print an area 400 pixels wide
// and 600 pixels high of frame 3 of the "dance_mc" movie clip
// in vector format at 50% of its actual size
var x:Number = fundo_mc._xscale;
var y:Number = fundo_mc._yscale;
fundo_mc._xscale = 50;
fundo_mc._yscale = 50;
if (impressao.addPage(0,{xMin:0,xMax:1024,yMin:0,yMax:768},null, 3)){
fundo_mc._xscale = x;
fundo_mc._yscale = y;
}
impressao.send();
delete impressao;
}
View Replies !
View Related
PrintJob From An URL
Im trying to use printJob to print a file from an URL, is this possible ?
here is my printJob
ActionScript Code:
bar_mc.print_btn.onRelease = function():Void{
var pj = new PrintJob();
var success = pj.start();
if(success)
{
//pj.addPage (0, {xMin : 0, xMax: 400: yMin: 0, yMax: 400});
pj.addPage("http://www.waringcollins.com/wsademomag/pdfs/test.pdf", {xMin : -300, xMax: 300, yMin: 400, yMax: 800});
pj.send();
}
delete pj;
};
when i call this from my print button (bar_mc.print_btn) the print dialog box comes up ok, but the print has spooled my main .swf file and not the file the URL is pointing to (this is when I preview my print from a local test).
Is this because I am testing locally or am I missing something to print a file from an URL ??
thanx for any ideas.
View Replies !
View Related
Printjob
I have 100 external swf files
In a new flash movie i want to call a printjob that will print some of the external swf its on a different page.
for example i want to print
1.swf
55.swf
and 66.swf
is it possible?
View Replies !
View Related
PrintJob Help
I am having difficulty with printing specific frame numbers and the dynamic XML code loaded into my Flash movie. All this code does is print the current frame (totally ignores the frameNum parameter) and does not print the dynamic code. Any help would be GREATLY appreciated.
Code:
//----print-------------
function printTut(myevent:MouseEvent):void{
var mySprite:Sprite = new Sprite();
mySprite.addChild(stage);
mySprite.rotation=90;
mySprite.scaleY=.80;
mySprite.scaleX=.80;
var frameNum:Number = 7;
var printArea:Rectangle = new Rectangle(0,0,991,583);
var myOption:PrintJobOptions = new PrintJobOptions();
myOption.printAsBitmap = true;
var myPrintJob:PrintJob = new PrintJob();
myPrintJob.start();
myPrintJob.addPage(mySprite,printArea,null,frameNum);
myPrintJob.send();
}
print_btn.addEventListener(MouseEvent.CLICK,printTut);
View Replies !
View Related
PrintJob
I have a movie where the current page (level 5) prints out but my movie is 1000 x 725 which is too large for an 8 1/2 x 11 sheet of paper.
I thought there was a way to scale the output to fit on the paper - is there? Remember, I'm print out an entire level, not a movieclip.
Thanks.
Rob Childress
View Replies !
View Related
PrintJob
Hi All,
Im trying to print string using action script.
When the text is too long it is not taking the next page it is printing in the 1st page and cutting off the rest
and Im not able to set the left,right,top,bottom margins.
can any one help me to resolve this problem please
code:
(please add more text to msg while testing)
var msg:String = "fertilizer use resulting in ↑ P adsorbed to soil particles<"+" ** Bennett EM;"+
"co NF;Correll DL; et al. (1998) Nonpoint pollution of surface waters with phosphorus and nitrogen."+
"P adsorbed to soil particles</b>"+" ** Bennett EM;Carpenter SR;Caraco NF. (2001) Human impact on "
//print code
doPrint(msg);
function doPrint(msg) {
trace(msg);
_root.createTextField(instanceName="print_txt", 1, 10, 10, 400, 100);
_root.print_txt._x = 100;
_root.print_txt._y = 100;
_root.print_txt.autoSize = true;
_root.print_txt.wordWrap = true;
_root.print_txt._visible = true;
_root.print_txt.text = msg;
var pjTest:PrintJob = new PrintJob();
if (pjTest.start()) {
pjTest.addPage(_root.print_txt, {}, true);
trace("height is :"+pjTest.pageHeight);
}
pjTest.send();
delete pjTest;
}
Thanks much in advance
Lally,
View Replies !
View Related
Looping PrintJob
HI,
I have created a project which loads in dynamically selected images and text. In order to print this each page has to be visible.
This is off course no "biggie" when printing one offs, but I want to include an option that lets users print a range of pages.
To do this I have used a looping control clip which tells the root timeline to move on one frame at a time. Then I was hoping to use the Printjob and add a page to the print job on every frame, then send all the added pages to the printer.
But I have found that printJob seems to only work when start(),addPage and send are all in the one function and not spread accross multiple frames as I have done.
_______________________________________________
code for print button:
print_butt.onPress=function()
{
//create printjob
my_pj = new PrintJob();
//if dialog box selected goto and play "printloop" frame
if (my_pj.start()) {
gotoAndPlay("printloop");
}}
code on: "printloop"
//ass frame to printjob
if(my_pj.addPage(_level0, null, null, 0))
{
pageCount++
}
code on:next frame
//increment _root frame, if from=to: stop looping
_root.p_from += 1;
if (_root.p_from>_root.p_to) {
gotoAndStop("printPause");
} else {
//set orientation and send spool to printer
my_pj.orientation = "landscape";
my_pj.send();
//clean up
delete my_pj;
//add another page to print job
gotoAndPlay("printloop");
}
____________________________________________
As you can see from above Im not great at coding But if anyone can decipher my coding and offer any guidance.....Kind thanks to you
View Replies !
View Related
PrintJob Class
I am using the printjob class to try and print a page in my flash movie. This works fine in the testing environment but when I move it to the browser It prints a blank page.
I don't believe the code is the problem since the print dialogue box pops up and everything. But here is the code I am using.
Code:
on(click)
{
//Print page
var my_pj = new PrintJob();
if(my_pj.start())
{
_root._xscale = 75;
_root._yscale = 75;
if(my_pj.addPage(0))
{
my_pj.send();
}
}
delete my_pj;
//_root._xscale = 100;
//_root._yscale = 100;
}
View Replies !
View Related
PrintJob Problem
I'm making a photo presentation in Flash and i'm building a print function.
But i have to rotate my MC depending on the printer setting and my input was using the PrintJob.orientation in an if statement for this. This doesn't work.
Here's my error report and below that is my code.
(The flash version I use is Flash MX 2004 Professional)
ERROR REPORT:
**Error** Symbol=control plans, layer=Layer 3, frame=1:Line 8: The property being referenced does not have the static attribute.
if ( PrintJob.orientation == "Portrait" ) {
**Error** Symbol=control plans, layer=Layer 3, frame=1:Line 14: The property being referenced does not have the static attribute.
} else ( PrintJob.orientation == "Landscape") {
**Error** Symbol=control plans, layer=Layer 3, frame=1:Line 21: The property being referenced does not have the static attribute.
if ( PrintJob.orientation == "Portrait" ) {
**Error** Symbol=control plans, layer=Layer 3, frame=1:Line 27: The property being referenced does not have the static attribute.
} else ( PrintJob.orientation == "Landscape") {
Total ActionScript Errors: 4 Reported Errors: 4
ACTIONSCRIPT:
Code:
printknop.onRelease = function()
{
_parent.menu._alpha = 0;
var printer = new PrintJob();
var myResult = printer.start();
if(myResult){
myResult = printer.addPage (0, {xMin : 0, xMax: 800, yMin: 0, yMax: 800});
if ( PrintJob.orientation == "Portrait" ) {
_parent._rotation += 90;
_parent._yscale = 90;
_parent._y += 109;
_parent._xscale = 90;
_parent._x -= 120;
} else ( PrintJob.orientation == "Landscape") {
_parent._yscale = 90;
_parent._xscale = 90;
}
printer.send();
}
delete printer;
if ( PrintJob.orientation == "Portrait" ) {
_parent._rotation -= 90;
_parent._yscale = 100;
_parent._y -= 109;
_parent._xscale = 100;
_parent._x += 120;
} else ( PrintJob.orientation == "Landscape") {
_parent._yscale = 100;
_parent._xscale = 100;
}
_parent.menu._alpha = 100;
}
Maybe there's a very simple solution to this but i don't know it. And i'm just a newbie that's learning.
So, thanxz to everybody who would like to take a look at this for me!
View Replies !
View Related
Printjob - Scale
Trying to scale what I´m printing... cause it´s bigger than the paper.
Code:
on(release){
PrintJob1 = new PrintJob()
PrintJob1.start();
PrintJob1.addPage(_root, {xMin:0,xMax:550,yMin:0,yMax:600},null,2);
PrintJob1.send();
}
I have another question too.. =)
Right now it prints frame 2 on Scene 1. I want it to print frame 2 on Scene 5. How..?
Thankful for any help!!
/Jakob
View Replies !
View Related
Printjob Fit On Page
I've got a swf. One of the functions in it is to print the current frame. This all works fine with a button and printjob action... I want to make sure it only prints within the bounds of the movie (980 x 615). I use the following code:
on(release){
my_pj = new PrintJob()
my_pj.start();
my_pj.addPage(0, {xMin:0,xMax:980,yMin:0,yMax:615})
my_pj.send();
delete my_pj;
}
However, I'd like this print to fit on the page (e.g. A4).. Right now it just prints one page and part of the image is cut off, if you catch my drift. It does do the bounding box correctly, though.
Is there a way I can get it to scale the print so that it fits on the page?
View Replies !
View Related
Anyone Know How To Use :PrintJob Class ?
Hi, I know that I can use the PrintJob class: PrintJob.start(), PrintJob.addPage(), PrintJob.send() to send my data to my printer. But I cant find any sample on the net. Anyone here knows where I can find a sample of .fla file where I can learn how to use this function??
Thanks alot....
View Replies !
View Related
PrintJob Questions
Anyone here did more complex PrintJobs before?
I'm trying to make a popup menu right after the PrintJob.start() function, so that the user can do some page setup.
The menu will make use of the properties within the PrintJob object, and finally create the pages using addPage() and then send().
Some things I've observed...
- The print job gets sent to the printer even without calling PrintJob.send(), so what is this function for??
- The PrintJob object is valid only for that frame. After I had this popup menu, the PrintJob object is no longer valid it seems.. I couldn't retrieve its properties after the current frame is over.
Anyone with advice on this?
View Replies !
View Related
Printjob Function
Hi,
I need some help , i have a frame with 3 MC's and i want print all at same time, i found the "printjob" but is for MX2004 and AS2, i cant convert my job to AS2 cause i get many errors in components and the funcion printjob is only for MX2004.
Someone have a code to do the same as printjob funcion, but for FlashMX version.
I apreciate the help is very urgent. Tks.
View Replies !
View Related
Strange PrintJob
using MX and printJob i am trying to print a large movie over a couple of A4 pages.
the movie (mcTest) is 745 pixels wide and 681 pixels high.
so on the assumption that an A4 page is 595 x 822 pixels, i was using the following addPage commands to send the pages to the printJob :
pj.addPage("mcTest"{xMin:0,xMax:595,yMin:0,yMax:68 1},1);
pj.addPage("mcTest"{xMin:595,xMax:745,yMin:0,yMax: 681},1);
...and expecting the first page to have the majority of the movie on it and the rest on the second page.
the first page prints OK but the second is blank.
and if i tweak the second line so that xMin has a value of 395 is starts to look correct. but to my logic it should then be overlapping by 200 pixels.
has anyone done much work with printJob() and if so, am i missing something here??
thanks in advance for any suggestions.
View Replies !
View Related
Printjob Nightmare
Hi I am a newbie to this forum. So 'hello everyone'. I am having a bit of a crisis at the minute with a deadline coming up and I am wondering if anyone can help.
I am trying to get a print button to work dynamically. when the button is pressed an image is downloaded into an MC and when complete it should print. Which would be nice. Not the case though.
In principle it works. the print dialog will appear when the images have completely downloaded but it also appears throughout the downloading process. from the start to the finish. The dialog box can appear tons of times depending on the download time.
What is happening is the print dialog box comes up straight away and even though you press print or cancel it continues to come up until the entire image is downloaded. As the swf stalls each time the print dialog box appears it can take some time for the image to load.
I have been stuck on this for weeks. I have listed the code below and would be eternally grateful to anyone who could help me get passed this hurdle.
Cheers !!!
//button code
on (release){
_root.startingPrinting();
}
function startingPrinting(){
var printFirst = page;
var printSecond = page +1;
// Using ZoomifyViewer to render images - printing 2 pages at a time
_root.print1.print1.setImagePath(printFirst);
_root.print1.print1.updateView();
_root.print2.print2.setImagePath(printSecond);
_root.print2.print2.updateView();
_root.initCheck();
}
function initCheck(){
myInterval = setInterval(startChecking, 1000);
}
function startChecking(){
var print2IsReady = _root.print2.print2.checkTileQueue();
if(print2IsReady==false) {
clearInterval(myInterval);
trace("It's finally loaded! Print now!");
_root.readyToPrint();
}
}
function readyToPrint (){
printJob = new PrintJob();
if (printJob.start())
{
printJob.addPage(_root.print1,{xMin:0,xMax:583,yMi n:0,yMax:763},{printAsBitmap:true},"");
printJob.addPage(_root.print2,{xMin:0,xMax:583,yMi n:0,yMax:763},{printAsBitmap:true},"");
printJob.send();
}
else
{
trace( "print start failed");
}
delete printJob;
}
thank you
View Replies !
View Related
PrintJob Class
hi,
have spent a couple hours trying to get the PrintJob class working but with no luck.
i am trying to print a dynamic text box inside a movieclip. the dynamic text box brings in an xml file. my file is identical to the help files example on using style sheets with xml and it works perfectly fine.
i've previously used the print function with no trouble, the print dialogue box was brought up even though i don't have a printer attached. now i am trying to use the PrintJob class i can't get the dialogue box to appear.
i've followed all the help files in flash. i've copied the code straight from the help files and simply renamed and rerouted things accordingly but it doesn't work.
i'd appreciate any tips, things to check or simple examples of the PrintJob class actually working.
cheers,
dave.
View Replies !
View Related
Some Help With Printjob Please Chaps
I am needing to print potentially large volumes of text from a flash swf. I have looked into the printjob functionality, and it seems to be what is needed here as i need multipage printing, and for the text to display properly on the printed page.
I am struggling, however, to see how you target a specific textfield or variable, to be the sole content that is printed.
Essentially, i just want to print the contents of a textfield via printjob... Does anyone have an easily moddable script/fla i could use?
the example scripts for printjob i have found sont seem to target a textfield/movie clip etc.
thanks in advance
Phil
View Replies !
View Related
PrintJob AddPage() HELP
I have a phot gallery that allows the user to print off any picture he/she likes. It prints the picture fine, but i want to also print the caption. The picture and the caption are on two different layers so i have two different addPage() calls. This, however, prints out two spereate pages (obviously). how can i make the captions print on the same page as the picture?
Here's my code:
function prnt_funct(eventObj:Object)
{
var my_pj:PrintJob = new PrintJob();
if (my_pj.start()) {
if ( my_pj.addPage("slideShow_mc", {xMin : 0, xMax: 400, yMin: min, yMax: max}) &&
my_pj.addPage("txt.description_txt" ) ) ){my_pj.send();
}
}
delete my_pj;
}
View Replies !
View Related
[F8] Possible PrintJob Class Bug ?
I'm using the PrintJob Class for the first time. It seems simple enough but when I use the parameters in the addPage() method to isolate a section of the movie I want to print, my print output is skewed about 25% to the left and the runoff gets flipped over to the other side. In short - the print output is all distorted. I've tried several printers on the network and they all show the same results. However, when I remove the section specific parameters and instead send the entire clip to the printer, it comes out perfect. I need to be able to print sections though.
Here's my code:
myClip.printButton.onPress = function(){
trace("PRINT");
var my_pj:PrintJob = new PrintJob();
if (my_pj.start()) {
if (my_pj.addPage(0,{xMin:10,xMax:188,yMin:20,yMax:22 7},{printAsBitmap:true}, 0)) {
my_pj.send();
}
}
delete my_pj;
}
stop();
I don't seem to be doing anything out of the ordinary here. My Google search turned up empty so perhaps this isn't a common problem. I'm at a loss and hopefully someone here can help me out.
Thanx in advance.
View Replies !
View Related
Does PrintJob Have To Be Entirely In 1 Frame?
I have a movie in which images and text fields change as frames advance.
I have four frames that are set up as templates. My movie changes the contents of these four templates dynamically.
I want to print each template after it is updated and I want to print everything as a single printJob.
Can printJob do this? I seem to have problems creating a printJob on one frame and then trying to add pages when I move to different frames.
Can printJob be spread across different frames?
View Replies !
View Related
[F8] Question About PrintJob
Hi, I have a problem when printing some information displayed on screen. The information is displayed on a TextArea.
The first problem I ran into, already solved though, was that only the lines displayed on the textArea where printed. As I've said, I could solve this by forcing it to be scrolled before adding the next page. But now the problem is: the textArea is printed as it is, with its width, height and its scroll bar, leaving a lot of blank space.
So, how can I output the data so that it covers the space I want it to cover?
View Replies !
View Related
PrintJob Not Working?
Could anyone tell me why this works in Flash 7 but when I up it to 8 it prints just a blank page?
I am guessing part of it is not compatiable, but I do not know which part.
Thank You!
ActionScript Code:
pS = 1.25;
print.onRelease = function() {
pJ = new PrintJob();
success = pJ.start();
if (success) {
_level0.paper.pagePrint._xscale *= pS;
_level0.paper.pagePrint._yscale *= pS;
pJ.addPage(_level0.paper.pagePrint);
pJ.send();
_level0.paper.pagePrint._xscale /= pS;
_level0.paper.pagePrint._yscale /= pS;
}
delete pJ;
}
View Replies !
View Related
AttachBitmap - PrintJob
hello everybody,
the combination out of bitmapData class and the printJob makes me big trouble. the result of the print is the backgroundcolor instead of the picture I want to print. I attached you a example file, where you can see my problem.
hope somebody can help.
thanks in advance;
boarter
View Replies !
View Related
How Do I Use The PrintJob Class
I have a flash file that contains multiple dynamic text boxes that loads in external .html files depending on which button is pressed.
How do you print the contents of a dynamic text box, where
the content changes when a user clicks a button?
I have looked at the Macromedia Livedocs - PrintJob Class, but do not understand how to link the actionscript to the dynamic text boxes...
Can someone help?
khd_man
View Replies !
View Related
PrintJob Problem
Hi guys,
i'm struggling with fixing a little problem with the printJob function;
problem i'm facing is that when i call the print function, it opens the print dialog box fine, i can select landscape orientation in my print settings, and the movieclip is printed fine... but when i select portrait as my orientation, the movieclip is clipped on the right edge (vertical scale is fine)...
here's the code i'm working with (courtesy of a previous ActionScript.org post):
Code:
function printScreen(mc_content:MovieClip):Boolean
{
printFlag = false;
var pageSpooled:Boolean = false;
var my_pj:PrintJob = new PrintJob();
var Orig_xScale:Number;
var Orig_yScale:Number;
// Open Print dialog using .start - if my_pj.start returns false, user
//canceled print dialog...
if (my_pj.start())
{
var PrintWidth:Number, PrintHeight:Number;
var MCWidth:Number, MCHeight:Number;
var MCOrigXScale:Number, MCOrigYScale:Number;
var MCRotated:Boolean = false;
var ScaleFactor:Number;
// Get the printer's width and height dimensions...
PrintWidth = my_pj.pageWidth;
PrintHeight = my_pj.pageHeight;
// Get the dimensions of the movieclip we're printing
MCWidth = mc_content._width;
MCHeight = mc_content._height;
// Handle Scaling...
// Capture current MovieClip X and Y Scale to restore later
MCOrigXScale = mc_content._xscale;
MCOrigYScale = mc_content._yscale;
// Match orientation of Movie Clip to orientation of Printer...
if (my_pj.orientation == "landscape")
{
// If orientation is landscape, then make movieclip portrait.
if(MCWidth < MCHeight)
{
mc_content._rotation = 90;
MCRotated = true;
}
}
else
{
// If orientation is portrait, then make sure movieclip matches.
if (MCWidth > MCHeight)
{
mc_content._rotation = 90;
MCRotated = true;
}
}
// Determine if width or height is to be used to scale image...
if (MCWidth > MCHeight)
{
if (MCRotated) ScaleFactor = PrintWidth/MCHeight;
else ScaleFactor = PrintWidth/MCWidth;
}
else
{
if (MCRotated) ScaleFactor = PrintWidth/MCWidth;
else ScaleFactor = PrintWidth/MCHeight;
}
// Execute scaling process
mc_content._xscale = ScaleFactor*100;
mc_content._yscale = ScaleFactor*100;
// Now that movieclip is scaled to printer size, spool page.
pageSpooled = my_pj.addPage(mc_content)
// Now re-scale movieclip being printed to original scale...
mc_content._xscale = MCOrigXScale;
mc_content._yscale = MCOrigYScale;
if (MCRotated) mc_content._rotation = 0;
}
// If addPage() was successful, print the spooled page.
if (pageSpooled)my_pj.send();
delete my_pj;
if (pageCount > 0) return(true);
else return(false);
}
This problem is repeatable, both in all attached printers, Microsoft Document Image Writer and Adobe Distiller...
any ideas???
Bomski
View Replies !
View Related
PrintJob And Scrollbar
using the PrintJob class, is there a way to print all the content from a textfield.
The problem is the text on the bottom that needs to be scrolled is not being printed.
Is it possible or am I just wasting my time. Please help
View Replies !
View Related
Why Won't My Printjob.start
Grrr....Why won't it start. The button works fine, the script never executes in the if(success)
Help please. I thought this printjob stuff was supposed to be easy.
Code:
this.print_btn.onRelease = function()
{
var pj = new PrintJob();
var success = pj.start();
if(success)
{
pj.addPage("printMe_mov", {xMin : 0, xMax: 524, yMin: 0, yMax: 593});
pj.send();
this.nextbtn._visible = true;
}
delete pj;
}
View Replies !
View Related
PrintJob(); Question...
Hi guys,
Sorry to be such a newb, I have a flash calculator that I programmed and my question is about the printing system.
I have a dataslider mc (_root.dataslider), where I do all the calculator calculations, then at print time, I load a separate set of mcs (printDataSHeet1 and 2) to format the content for printing. They are supposed to dynamically pull text out of _root.dataslider just prior to printing but this is not happening and I am getting all default values.
This happens whether I try to load them from the library and attachMovie them to a created movieclip or if I place the mc out of sight of the user and then add its frames as pages to the printjob.
Any ideas? This is going to drive me nuts! Can actionscript execute when printJob.addPage(); is scrubbing the timeline of the target mc forward or am I locked into whatever, non-dynamic values are there?
Here is the printing code:
(I am a noob, plz be gentle)
Code:
_root.navbuttons.btprint.onRelease = function() {
_root.dataslider.calcIt();
_root.createEmptyMovieClip("page1", 8);
_root.page1.attachMovie("dataSheetPrintable1", "dataSheet1", 0);
_root.page1._y = 0;
_root.page1._xscale = 72.5;
_root.page1._yscale = 72.5;
_root.createEmptyMovieClip("page2", 10);
_root.page2.attachMovie("dataSheetPrintable2", "dataSheet2", 0);
_root.page2._y = 1000;
_root.page2._xscale = 72.5;
_root.page2._yscale = 72.5;
// We're printing below this line
// create an instance of the PrintJob Class
// Actual printing is disabled for now, fields are not populating...why?!
var printJob_pj = new PrintJob();
// if user presses ok at the system default print dialog
if (printJob_pj.start()) {
trace("Page Height: "+printJob_pj.pageHeight);
trace("Page Width: "+printJob_pj.pageWidth);
// add frame 1 of theMovieclip to the print queue
printJob_pj.addPage("page1", {xMin:0, xMax:850, yMin:0, yMax:1100}, {printAsBitmap:false}, 1);
// add frame 1 of theMovieclip to the print queue
printJob_pj.addPage("page2", {xMin:0, xMax:850, yMin:0, yMax:1100}, {printAsBitmap:false}, 2);
// send spooled info to printer
printJob_pj.send();
}
// clean up
delete printJob_pj;
_root.page1.removeMovieClip();
_root.page2.removeMovieClip();
};
View Replies !
View Related
PrintJob-Class …. How To ….. ?
I would like to be able to print a external loaded text with the PrintJob-Class – but I would like to print the text with a different layout than the one on the website.
I’ve tried to place i ton a special ”printFrame” in frame 5:
myPrintJob.addPage(0, {xMin:0, xMax:500, yMin:0, yMax:800}, null, 5);
….. the graphix prints out fine – but not the external loaded text
Du YOU have a way to do this???
Greetings from Lars, www.medieskolen.dk, Denmark
This is how i load the text:
ExternText = new LoadVars();
ExternText.onData = function(denLoadedeText) {
tekst_txt.htmlText = denLoadedeText;
};
ExternText.load("externtext.txt");
tekst_txt.autoSize = "right";
This is the code on the printButton:
btn.onRelease = function() {
var myPrintJob = new PrintJob();
var success = myPrintJob.start();
if (success) {
myPrintJob.addPage(0, {xMin:0, xMax:500, yMin:0, yMax:800}, null, 5);
myPrintJob.send();
}
delete myPrintJob;
};
View Replies !
View Related
PrintJob Problem
Hi all~
i use code to print a page of my movie like this:
Code:
btn_print.onRelease = function()
{
var printer = new PrintJob();
if (printer.start())
{
//if (printer.addPage(target:Object, [printArea:Object], [options:Object], [frameNum:Number]))
if (printer.addPage(0, null, null, 90))
{
printer.send();
}
}
else
{
trace("Error: Can not find a printer !");
}
delete printer;
}
but there's a problem. ie, this function works only once. the next time i clicked the print button but nothing happened. i made some test and found it is because onRelease handler(of print button named btn_print) get removed automatically after first printing, so i added a detector movieclip to check and reassign same handler to that button once its handler gets deleted. but it caused system print dialog appeared again and again, i had to close flash movie to stop it, is this a Flash bug ? anyone could figure out how to fix it ? one million thanks !!!
View Replies !
View Related
PrintJob Issue
I am having difficulty specifying the frame to print (only prints current frame and ignores the frameNum parameter) and does not print the dynamic XML text that I have loaded to the movie. Can you help on this?
Code:
function printTut(myevent:MouseEvent):void{
var myPrintJob:PrintJob = new PrintJob();
var mySprite:Sprite = new Sprite();
var printArea:Rectangle = null;
var options:PrintJobOptions = null;
var frameNum:int = 2;
mySprite.addChild(stage);
mySprite.rotation=90;
mySprite.scaleY=.80;
mySprite.scaleX=.80;
myPrintJob.start();
myPrintJob.addPage(mySprite,printArea,options,frameNum);
myPrintJob.send();
}
print_btn.addEventListener(MouseEvent.CLICK,printTut);
View Replies !
View Related
PrintJob Question
Hi
Im trying to print off a loaded jpg from my flash movie.
I have done some testing and just have one question regarding this, and hope someone can help....
Does the loaded file need to be displayed on Stag for it to print?
View Replies !
View Related
Test PrintJob Please
Hello,
Can you please test http://www.pixelplay.net/lagardeTest/ section "contact" subsection "plan", try to print it and tell me the result you have on paper+ copy-paste of the debug textfield (above the plan); My client keep saying that it doesn't print anything (it does print on my side). This thing is driving me crazy ;(
here goes the code I'm using por the printing:
ActionScript Code:
bt_print.addEventListener(MouseEvent.CLICK,clickHandler);
import flash.printing.PrintJob;
import flash.display.Sprite;
function clickHandler(e:MouseEvent)
{
var my_pj:PrintJob = new PrintJob();
var mySprite:Sprite = new Plan_print();
debug.appendText("my_pj.start
");
if(my_pj.start())
{
debug.appendText("my_pj.pageHeight= "+my_pj.pageHeight+"
");
debug.appendText("my_pj.pageWidth= "+my_pj.pageWidth+"
");
debug.appendText("mySprite= "+mySprite+"
");
debug.appendText("mySprite= "+mySprite.height+"
");
debug.appendText("mySprite= "+mySprite.width+"
");
if (mySprite.height > my_pj.pageHeight)
{
mySprite.scaleY = my_pj.pageHeight / mySprite.height;
}
if (mySprite.width > my_pj.pageWidth)
{
mySprite.scaleX= my_pj.pageWidth / mySprite.width;
}
debug.appendText("mySprite.scaleX= "+mySprite.scaleX+"
");
debug.appendText("mySprite.scaleY= "+mySprite.scaleY+"
");
my_pj.addPage(mySprite);
my_pj.send();
}
}
View Replies !
View Related
PrintJob - Position
Hi
Is there any way to position items on page before printing (I just need some margin). Setting x,y makes no effect.
I tried to play with bitmaps, but in most cases nothing appears on Page ;/
View Replies !
View Related
Printjob Function
Hi,
I need some help , i have a frame with 3 MC's and i want print all at same time, i found the "printjob" but is for MX2004 and AS2, i cant convert my job to AS2 cause i get many errors in components and the funcion printjob is only for MX2004.
Someone have a code to do the same as printjob funcion, but for FlashMX version.
I apreciate the help is very urgent. Tks.
View Replies !
View Related
PrintJob And Mask
Hi guys,
I have a textfield with _height=400 masked by a MovieClip with _height=200
and when I call printJob class, it prints only what's _visible in the mask, I would like to print the entire text in the textfield, not only the masked area.
is there any way?
my code is:
Code:
var pj:PrintJob = new PrintJob();
//
if (pj.start()) {
var pagesToPrint:Number = 0;
//
if (pj.addPage("newcampo")) {
pagesToPrint++;
}
//
if (pagesToPrint > 0) {
pj.send();
}
}
View Replies !
View Related
PrintJob: Resizing
I have a movie where the current page (level 5) prints out but my movie is 1000 x 725 which is too large for an 8 1/2 x 11 sheet of paper.
I thought there was a way to scale the output to fit on the paper - is there? Remember, I'm print out an entire level, not a movieclip.
Thanks.
Rob Childress
View Replies !
View Related
Printing With PrintJob
Hello, i'm developing an application for standalon self attending multimedia kiosks, and I wish to print some stuff without going thru the OS Print Dialog Box... It seems PrintJob does not work without calling the .start() method (which opens the Dialog Box) is there any way to workaround this problem?
Thanks in advance
Wilson
View Replies !
View Related
PrintJob Weirdness
I have done various searches on the PrintJob class but could really do with some advice please.
I have a movie that offers a choice of 3 flyers to print out, so there are 3 initial buttons.
When a button (say flyer 1) is clicked it loads flyer1.swf into an empty mc with the instance name of flyer.
Flyer1 has 2 frames: in the first there is an input text field called dateIn_var, in frame 2 there is dynamic text field called dateOut_var. There's a stop(); in frame 1 and the code in frame 2 is: dateOut_var = dateIn_var;
In the root movie in frame 1 there are the 3 buttons. Also in this frame number is the empty mc flyer.
My code for loading the flyers is:
................
flyer1_bt.onRelease = function () {
flyer.loadMovie("flyer1.swf");
gotoAndStop(5);
}
...............
This loads my flyer and advances the playhead to frame 5 on the root timeline where I have a print button (print_bt).
on frame 5 I have this code:
................
print_bt.onRelease = function() {
flyer.gotoAndStop(5);
var pj:PrintJob = new PrintJob();
var success = pj.start();
if(success)
{
pj.addPage(0,{xMin:0, xMax:355, yMin:0, yMax:500}, {printAsBitmap:false}, 5);
pj.send();
}
delete pj;
}
.............
This updates my flash movie's dynamic text field but when I press the button on my computer's print dialog box, I get a print out of my flyer with empty dynamic text fields. The weird thing is that if I do a second print the text fields print out as intended. It seems like the code is stopping the movie before the text fields load initially and then continuing AFTER a print has been made.
Is there a way to resolve this? I have tried moving the code for my dynamic text to an earlier frame without luck so far.
(BTW the code below appears after attempting to use the attach code button on Safari...)
Attach Code
flyer1_bt.onRelease = function () {
flyer.loadMovie("flyer1.swf");
gotoAndStop(5);
}
View Replies !
View Related
Printjob - Can't Understand
first thing, the user is loading the MC to the stage. the print button is located in the MC. now i want only the MC to be printed. if necessary, the button can be on the main stage.
in the following script that I found:
this.createEmptyMovieClip("holder_mc", 999);
holder_mc.loadMovie("
View Replies !
View Related
|