A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Printing to a Printer

  1. #1
    Member
    Join Date
    Feb 2002
    Location
    Australia
    Posts
    63

    Printing to a Printer

    Hi all,

    Re: Action script.
    I am trying to create a “print” button to print a screen page displayed with my standalone flash player. I have set up a short test for the user and would like them to be able to print their final score results including some graphics “like a certificate with score results.

    If anyone has a little working sample, that would help me a lot.

    Thanx heaps

    Clive

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    Simplest thing is to do this on button to print mc1
    my_pj= new PrintJob();
    my_pj.start()
    my_pj.addPage("mc1");
    my_pj.send()
    delete my_pj

    You can add pages and you can also do compete error checking that I've not shown here. This will print out everything in a clip named mc1. You can supply any clip and even set what portion of it you want to print.

    You should check out the docs at
    http://livedocs.macromedia.com/flash...rt4_ASLR2.html

  3. #3
    Member
    Join Date
    Feb 2002
    Location
    Australia
    Posts
    63
    Thanx blanius ,

    I will give it a test.

    Thanx again

    Clive

  4. #4
    Member
    Join Date
    Jul 2003
    Posts
    80
    What if i have a bunch of movieclips on top of each other in an area of my swf? And i wanted to print that whole area, not just an individual MC?

  5. #5
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    You print the _root movie and set the area
    See the link above:
    addPage(target:Object, [printArea:Object], [options:Object], [frameNum:Number])

    If you passed a value for printArea, the xMin and yMin coordinates map to the upper left corner (0,0 coordinates) of the printable area on the page. The user's printable area is described by the read-only pageHeight and pageWidth properties set by PrintJob.start(). Because the printout aligns with the upper left corner of the printable area on the page, the printout is clipped to the right and/or bottom if the area defined in printArea is bigger than the printable area on the page. If you haven't passed a value for printArea and the Stage is larger than the printable area, the same type of clipping takes place.

  6. #6
    Senior Member jessicacrandall's Avatar
    Join Date
    Nov 2001
    Location
    Ozark Mountains!
    Posts
    153
    This pj function will only output in Flash player seven or higher, right?

    I have a movie in flash player 6 I am trying to get to print. Do you know anything about printAsBitmap() function?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center