PrintJob - Position
HiIs 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 ;/
ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 01-25-2009, 12:23 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Reset Movie Clip X-position & Y-position Back To Original
Is there a command to reset x-position, y-position and rotation all at once...like reset command?...or would I have to find the original x-positions and y-positions to all elements and hardcode that back....EEEK!!
Many Thanks
Andrea
SoundChannel.position - Trouble Triggering Event Based On .position
I would like to trigger an addChild event when my mp3 reaches a certain point.
My trace statements will only fire if I use <= but not ==
The goal is to add text to the stage when the MP3 has reached one second, what am I missing?
Ultimately there will be several trigger marks I need to hit along the MP3.
ActionScript Code:
var buffer:SoundLoaderContext = new SoundLoaderContext(10000);var welcome:Sound = new Sound(new URLRequest("Intro.mp3"), buffer);var welcomesc:SoundChannel = welcome.play();addEventListener(Event.ENTER_FRAME, playMessage);function playMessage(event:Event):void{trace(Math.floor(welcomesc.position));if (welcomesc.position == 1000) { trace("NOW!!!!!!!"); } else { trace("WAIT-------------"); }welcomesc.addEventListener(Event.SOUND_COMPLETE, soundComplete);}
How To Position Mc_example Depending On Position Of Empty Movieclip?
I have a series of movieclips (graphics) which I want to position in a row.
I know that I can define the position of each movieclip individually by _x and _y. But can I place an empty MC on the stage and define the position of every single MC with _x and _y IN RESPECT TO THE POSITION OF THE EMPTY MC - so that ALL movieclips will change their position when I move the empty mc?
Thanks for helping
Aribert
[F8] Control Position Of Playhead In Movieclip By Position Of A Button
I am fairly new to actionscripting and just need a little help.
I have a bar which has a slideable block on it. When this block is dragged, to the left/right i want it to control the playhead inside another movieclip.
For example, when the block is to the far left, the playhead (of my movieclip) will be at the first frame. When the block is dragged to the right it will play the movieclip at the speed that the block is being moved and when it is at the far right it will be on the last frame of the movieclip. And when the block is dragged to the left it will play the movie backwards at the same speed etc...
It is just like the scrubber bars that are in media players, but instead of playing an actual video, i want to play the movieclip which is of an animation.
How would I do this?
Thanks
Flash Y Position Converted To Browser Scroll Position
I have a Flash movie that makes an fscommand call to the HTML page, and via Javascript, it moves the browser window scroll position down. I need to be able to scroll down to a position that coincides with a Y position on my Flash page, but I can't seem to figure out how to convert coordinates from a Flash Y position to a browser-window vertical scroll position. I hope this makes sense. Does anyone know how to do this? (I have all the code working to do this, except for this coordinate issue. That's the only part I need.)
Example:
Code:
myMC.onRelease = function() {
//Command to Javascript function in html doc
//Scroll down in browser to Y pos specified
//This scrolls down to 1000 position within browser window but
//but does NOT equate to a Y position of 1000 in .swf movie
//even if .swf movie is at 0,0 left & top margins within browser
fscommand("scrollToAnchor",1000);
};
Ultimately, what I am trying to do is simulate anchor points from HTML (not anchor points in Flash to go 'Back'), whereby you have a link at the top of the page, and you click it and it takes you somewhere else lower on the same page. Then you have a link there that says "Back to top", and it takes you back to the top of the page, etc.
Any ideas?
PrintJob
hi
Does anyone know of a printJob tutorial?
How could I print a movieClip using printJob?
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");
}
[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
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.
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.
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;
}
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.
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?
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);
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?
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
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,
PrintJob
Does anyone know a decent functionality overview for the new PrintJob Class or maybe even some sample implementations for it?
PrintJob
Does anyone know how to use PrintJob?
Thinking of printing data from DataGrid using PrintJob. Is it possible?
X Position? Y Position? Differs In MovieClips From _root?
Hey!
I'm confused:
I want to move a movieClip that is embedded in another movieClip:
firstMovieClip >> floatingMovieClip
Now, X = 0 IS NOT the upper left corner when I try to direct floatingMovieClip.
When I investigate the movieClip sets it's X = 0 in the middle. But on _root lever, X = 0 is the upper left corner.
Is it supposed to be this silly way?
THanks!
Regards
Help With Tweening From Current Position To Clicked Position
Hi
I have a motion tweening question-
I have a large rotary dial with an arrow on it, around that are 5 buttons. I want to set it up so that when the user clicks any button, the rotary dial will rotate until the arrow is pointing to that particular button. I can't figure out how to make it so that the dial tweens from one position to the other, which is of course dicated by where the user clicks. I also want that dial to stay pointed to that specific button until another one is clicked.
How can I do this?
Thanks!!!
-Steve
Mouse X Position To Control Movie Position?
Hi, my understanding of actionscript is very basic and I'd like some help with writing a very simple script. Basically the x position of the mouse should control the play position of a movie. Do I need something like an event handler (I'm not sure exactly what these do, but I've seen similar scripts that seem to use them).
Reported X Position Doesn't = Actual X Position?
I can't figure this out. I'm loading a serious of pages of images in the same flash document, but all pages after the first one have a lower y position of about the height of one of the images. When I trace their y position they all say 30, when it's clearly more like 150. What's going on here?
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
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;
}
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!
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
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?
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....
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?
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.
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.
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
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.
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
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;
}
[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.
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?
[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?
Printjob Sample Fla Plz..
Does anyone have a PrintJob Sample in fla format?? Even just a simple sample coz i can't get the tutorials correctly so if anyone plz...
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;
}
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
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
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
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
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;
}
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();
};
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;
};
|