help with compiling error
package com.wiley.as3bible.printing {
import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.printing.PrintJob;
public class Printing extends Sprite {
private var _printableContent:Sprite;
private var _textField:TextField;
private var _loader:URLLoader;
public function Printing() {
//Load the text from a text file
_loader = new URLLoader();
_loader.load(new URLRequest("http://www.rightactionscript.com/samplefiles/lorem_ipsum.txt"));
_loader.addEventListener(Event.COMPLETE, completeHandler);
//Create a multiline text field that autosizes.
_textField = new TextField();
_textField.width = 400;
_textField.multiline = true;
_textField.wordWrap = true;
_textField.autoSize = TextFieldAutoSize.LEFT;
//Create a sprite container for the text field,
//and add the text field to it.
_printableContent = new Sprite();
addChild(_printableContent);
_printableContent.addChild(_textField);
}
//When the text loads add it to the text field and then print the text
private function completeHandler(event:Event):void {
_textField.text = _loader.data;
var printJob:PrintJob = new PrintJob();
if (printJob.start()) {
printJob.addPage(_printableContent);
printJob.send();
}
}
}
}
the compiling error is:
1046: Type was not found or was not a compile-time constant: PrintJob.
1180: Call to a possibly undefined method PrintJob.
can anyone explain this to me?