Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Printing problems with Flash actionscript 3.0 application

Posted on 2011-10-01
2
419 Views
Last Modified: 2012-05-12
I am utilizing the following code to print the contents of my flash application after the user clicks the print button, the printer dialogue screen comes up and you select ok, but nothing prints, it doesn't even show any documents pending. Ive tried printing from other applications and there is no problems. Please advise.
 
function printContent(event: MouseEvent):void
{
var printContent = overallTrainingCost_txt.text + returnedDistance_txt.text + returnedTime_txt.text
var pageSprite: Sprite = new Sprite;
var printJob:PrintJob = new PrintJob();
   if (printJob.start()) 
   
if (printJob.start()) {

     if (printContent.width>printJob.pageWidth) {
         printContent.width = printJob.pageWidth;
		 printContent.wordWrap = true;
		 addChild (pageSprite);
		 pageSprite.addChild(printContent);
		 printContent.addPage(pageSprite);
		 
		 }
   
     printJob.send();
	 removeChild (pageSprite);
   }
}

Open in new window

MapSimple-Testing2.fla
0
Comment
Question by:fool5683
2 Comments
 
LVL 29

Accepted Solution

by:
dgofman earned 500 total points
ID: 36898750
I cannot see where in your code you are concatinating string.
Ok, try my solution and let me know if works for you or not

var textArea:TextField = new TextField();
textArea.multiline = true;
textArea.wordWrap = true;
textArea.text = overallTrainingCost_txt.text + returnedDistance_txt.text + returnedTime_txt.text;

var pageSprite: Sprite = new Sprite;
pageSprite.addChild(textArea);

var printJob:PrintJob = new PrintJob();  
if (printJob.start()) {
      textArea.width = printJob.pageWidth;
      textArea.height = printJob.pageHeight;
      printJob.addPage(pageSprite);
    printJob.send();
}
0
 

Author Closing Comment

by:fool5683
ID: 36899060
It worked perfectly! Thank you very much. You have been a godsend on this project dgofman:)
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Register AutoHotkey 12 84
Using a variable to name output in powershell script 2 40
How can i open a .fxp file 3 38
Can't enable Flash on Chrome 32 Windows 7 any more 2 22
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question