Skip to content

Instantly share code, notes, and snippets.

@darkredz
Created April 10, 2013 03:18
Show Gist options
  • Save darkredz/5351493 to your computer and use it in GitHub Desktop.
Save darkredz/5351493 to your computer and use it in GitHub Desktop.
public function init():void{
nativeWeb = new UIWebView();
nativeWeb.stage = stage;
nativeWeb.viewPort = new Rectangle(0,0,1024,748);
nativeWeb.loadURL('http://darkredz.com')
button.addEventListener(MouseEvent.CLICK, onClick)
nativeWeb.addEventListener(PrintJobEvent.COMPLETE, onDone)
nativeWeb.addEventListener(PrintJobErrorEvent.ERROR, onError)
}
private function onClick(e:MouseEvent):void{
//Simple Print
nativeWeb.printPage()
//print options with location of modal UI, header and footer text
//nativeWeb.printPage(PrintInfo.GENERAL,new Point(100,400), 'My Web Page', 'My footer',true)
}
private function onDone(event:PrintJobEvent):void {
trace('Done ' + event.url)
}
private function onError(event:PrintJobErrorEvent):void {
trace(event.toString())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment