Solved

PrintJob help in CS3

Posted on 2011-09-30
1
228 Views
Last Modified: 2012-08-14
I have the code below in one form, and it prints perfectly, but how can I call that Form within my project (I know exactly from which SWF I am gonna call it, and post some variables to it)
What I want to do is:

1 - Call a NEW completely independent movie (_self) named impresion.swf (the form I wanna print)
2 - I am calling that form from calculate.swf, you guess right I want to be able to just print the results from this page :)

Thanx for any help or suggestions !!!
By the way I am using CS3 and AS2

import mx.controls.Button;
var printBut:Button;
var my_pj:PrintJob;

printBut.onPress = function() {
    // create PrintJob object
      
   my_pj = new PrintJob();
    if (my_pj.start()) {
        if (my_pj.addPage(_root)) {
            my_pj.send();
        }
    }
};
0
Comment
Question by:crescue
1 Comment
 
LVL 29

Accepted Solution

by:
dgofman earned 500 total points
ID: 36895613
Try this

import mx.controls.Button;

var printBut:Button;
var my_pj:PrintJob;
var movieHolder:MovieClip;

printBut.onPress = function() {
    if(movieHolder)
            movieHolder.removeMovieClip();
      movieHolder = _root.createEmptyMovieClip("movieHolder", _root.getNextHighestDepth());
      var loader:MovieClipLoader = new MovieClipLoader();    loader.addListener(_root);
    loader.loadClip("calculate.swf", movieHolder);
};

function onLoadInit(mc:MovieClip)
{
      my_pj = new PrintJob();
    if (my_pj.start()) {
        if (my_pj.addPage(mc)) {
            my_pj.send();
        }
    }
};
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
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 how to load their YouTube profile onto Flash Media Live Encoder.

910 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

20 Experts available now in Live!

Get 1:1 Help Now