Solved

PrintJob help in CS3

Posted on 2011-09-30
1
227 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

757 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

22 Experts available now in Live!

Get 1:1 Help Now