Current location: Hot Scripts Forums » General Web Coding » Flash & ActionScript » Using PrintJob class


Using PrintJob class

Reply
  #1 (permalink)  
Old 03-27-10, 02:49 PM
blanthycolino blanthycolino is offline
New Member
 
Join Date: Mar 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Using PrintJob class

Hi all

I'm new to AS3 and was never all that proficient at AS2. I'm working on a simple drag and drop piece and I want to be able to print the contents of the drag and drop.

I'm trying to use the PrintJob class that comes with CS4 but its not working.

Here's what I have...

THE BUTTON HANDLER

Code:
print_btn.addEventListener(MouseEvent.CLICK,printContent);

function printContent(evt:MouseEvent) {
    var printJob:PrintJob = new PrintJob();

    if (printJob.start()) {

        if (content_MC.width>printJob.pageWidth) {
            content_MC.width=printJob.pageWidth;
            content_MC.scaleY=content_MC.scaleX;
        }

        printJob.addPage(content_MC);
        printJob.send();
    }
}

THE PrintJob CLASS INCLUDED IN CS4

Code:
//****************************************************************************
// ActionScript Standard Library
// PrintJob object
//****************************************************************************

intrinsic class PrintJob
{
    var orientation:String;
    var pageHeight:Number;
    var pageWidth:Number;
    var paperHeight:Number;
    var paperWidth:Number;

    function PrintJob();

    function addPage(target:Object, printArea:Object, options:Object, frameNum:Number):Boolean;
    function send():Void;
    function start():Boolean;
}

I keep getting all sorts of errors prompting me to edit the PrintJob class. But as soon as I make an edit it comes up with one error after another an won't work.

What am I missing here? Shouldn't the CS4 PrintJob class just be right out of the box? Sorry if this is such a newbie question. But I am a newbie!

Any help would be greatly appreciated.

Thanks in advance!
Reply With Quote
  #2 (permalink)  
Old 03-27-10, 06:41 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
You might want to post in CS4 forums up at Adobe.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reassign a variable, linked to a class, from within the same class Ryan75 PHP 2 04-27-09 11:30 PM
conceptual problem: abstract class, interface or class UnrealEd Everything Java 2 05-12-07 07:30 AM
I need to pass this class Please Help! Negative6 Everything Java 1 05-03-07 06:55 AM


All times are GMT -5. The time now is 06:52 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.