Hallo. I am building an Air application and i am trying to use the PrintJob class to print a page. In the actionscript 3.0 reference language i saw the PrintJob class and all it's methods.. My problem is that, in the reference help i can see some methods that i can't see in my application. There are some methods like printers, start2, which exists in the language reference but they don't exist in my flex 4 air application... In the reference this code works:
import flash.printing.PrintJob; var myPrintJob:PrintJob = new PrintJob(); myPrintJob.printer = "HP_LaserJet_1"; myPrintJob.start();
But if i do copy/paste to my application it says that the property printer is undefined.... Why??.. Do i have some problems with my sdk??.. I made some flex 4 application and i had no problems with flash player... This is my first Air application and i see that my class does not mathc with reference clas... why??..
Thx a lot
you're probably authoring "web based" flex application which is not using Air SDK (and have no dependencies set for Air runtime for authoring). That is why you're not seeing hints for Air-only api features and seeing compiler error.
*but* there is easy fix for that:
(make copy of your project using "Export' feature and export it to .zip to have a copy if something goes wrong")
right click on your project node in Flash Builder
choose: "Add/Change project type" then "Convert to Flex desktop ....." option
(my suggestion is to try that solution with new Flex web project to lear how that work before applying to your existing code)