Solved

Print the whole stage in AS3

Posted on 2007-11-16
3
1,516 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
Comment Utility
try this..

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

Z
0
 

Assisted Solution

by:baloney72
baloney72 earned 125 total points
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
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 shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

771 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now