1 Reply Latest reply on Jul 15, 2008 11:32 AM by zoom4267

    print button

    zoom4267
      im looking for a simple way to have a print button

      i have an image i would like people to print and i would like to have a button so when pressed it prints the image. ive seen alot of code but its for complex pages and grids and such and im not sure how to strip it down for what i need.

      thanks alot
        • 1. Re: print button
          zoom4267 Level 1
          I have this code from mytutorial book,,, it brings up the print box for my printer but when i click print nothing happens, so im missing something

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">

          <mx:Script>
          <![CDATA[
          import mx.printing.FlexPrintJob;
          private function doPrint():void{
          var pj:FlexPrintJob = new FlexPrintJob();
          if(pj.start() !=true)
          {
          return;
          }
          }
          ]]>
          </mx:Script>
          <mx:Panel x="234" y="126" width="250" height="200" layout="absolute">
          <mx:Button label="print" click="doPrint()" x="68" y="91"/>
          <mx:Text x="23" y="10" text="hello print test print test" width="178" height="57"/>
          </mx:Panel>

          </mx:Application>