A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Set alpha to 0 for printing

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    25

    Set alpha to 0 for printing

    I have a game I'm adding a print button to, for users to print their score at the end of the game. The problem is, is that the printing make some of the buttons look weird, for some reason (color is missing, a white box around the button, that should be empty/transparent). This is the script I'm using to print:
    Code:
    printButton.onPress = function() {
    print(drawingArea, "bframe")
    }
    I've tried a number of ways of making it so the buttons are seen normally, even tracing them as bitmap, but it makes everything lock up when I try to print that way and nothing else seems to work. So I want to temporarily make the buttons invisible, while it's printing, and then go back to vissible once it's done.
    It's easy enough setting the button alpha to 0, with
    Code:
    printButton.onPress = function() {
    buttonInstanceName._alpha=0;
    and then the script to print; it makes it invisible just before it prints, but what I need is way to reset the alpha to 100 once it's done printing. Is there any script that could help me do that?
    Last edited by stargazer1682; 08-03-2011 at 07:54 PM.

  2. #2
    Member
    Join Date
    Aug 2006
    Posts
    96
    Wouldn't this work? Just turn it off before calling the print function and turn it back on after the print is done?

    PHP Code:
    printButton.onPress = function() {
    buttonInstanceName._alpha 0;
    print(
    drawingArea"bframe")
    buttonInstanceName._alpha 100;


  3. #3
    Junior Member
    Join Date
    Apr 2011
    Posts
    25
    Thanks for the response - in both thread. This script for printing is more effective than the one mentioned in other thread, in that it actually works; there's just this slight hitch in using it.

    I actually tried scripting it like that and it turned the alpha up too quickly; it was back to 100 by the time it starts printing and was visible again. I thought maybe there was some kind of event listener or something I could put, that could trigger the line turning it back up to 100 after the printer was finished, or after it finished "spooling," or whatever preliminary stages it goes through, where the final image that's being printed has been sent; and the alpha can be safely turned back up.

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