Solved

Print the whole stage in AS3

Posted on 2007-11-16
3
1,525 Views
Last Modified: 2010-04-14
I'm wanting to print the entire stage in actionscript 3 (flex.) But the PrintJob.addPage() function only takes a sprite argument, and the stage isn't a sprite. I can think of two solutions:
1.) Add a sprite as the root element of everything else - a big deal because I've got a lot of controls and functionality already.
2.) Create a temporary sprite for printing and all all the stage's children to it. Not sure if this would even work...

Is there a simple way to just print the entire stage? Surely this isn't an unusual scenario?
0
Comment
Question by:jgr4
3 Comments
 
LVL 23

Accepted Solution

by:
Zeffer earned 125 total points
ID: 20305367
try this..

this.myBtn.onRelease = function() {
 print(this, "bmovie");
};

Z
0
 

Assisted Solution

by:baloney72
baloney72 earned 125 total points
ID: 22959794
Add the stage to a sprite.
And put the whole thing in a try/catch block just in case:
try{
  var pj= new PrintJob()
  pj.start()
  var sp = new Sprite()
  sp.addChild(stage)
  pj.addPage(sp)
  pj.send()
} catch(e){
}

Open in new window

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
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,…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

772 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