A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: Print image

  1. #1
    Junior Member
    Join Date
    Nov 2014
    Posts
    12

    Print image

    please help me with this script, when you click the button, print only the selected area by the black line.

    Attached Images Attached Images
    Last edited by andre felipe; 12-01-2014 at 12:20 PM.

  2. #2

  3. #3
    Junior Member
    Join Date
    Nov 2014
    Posts
    12
    not this printing, nothing happens, friend wanted from printing when I click the button

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Oh well, I don't have a printer so wouldn't know, attach your *.fla and lets see whats happening

  5. #5
    Junior Member
    Join Date
    Nov 2014
    Posts
    12
    hi I have a script just wanted to set the area that is to print it because it does not print the full picture, you know how to do?
    http://uploaddeimagens.com.br/imagens/flash_001-png



    print_bt.addEventListener(MouseEvent.CLICK, printThis);
    function printThis(e:MouseEvent):void
    {
    var myPrintJob:PrintJob = new PrintJob();
    myPrintJob.start();
    myPrintJob.addPage(card);
    myPrintJob.send();
    }

    var bd :BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight, false);
    bd.draw(stage);
    var b:Bitmap = new Bitmap (bd);
    var card:Sprite = new Sprite();
    card.addChild(b);

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Maybe
    PHP Code:
    print_btn.addEventListener(MouseEvent.CLICKprintThis);

    function 
    printThis(e:MouseEvent)
    {
        var 
    myPrintJob:PrintJob = new PrintJob();

        if (
    myPrintJob.start())
        {

            if (
    card.width myPrintJob.pageWidth)
            {
                
    card.width myPrintJob.pageWidth;
                
    card.scaleY card.scaleX;
            }

            
    myPrintJob.addPage(card);
            
    myPrintJob.send();
        }


  7. #7
    Junior Member
    Join Date
    Nov 2014
    Posts
    12
    gave error in Scene 1, Layer 'Panel, Table 10, line 27, column 13 1120: Undefined property access card.

    http://uploaddeimagens.com.br/imagen...ulo-png--10575

  8. #8
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    thats what you said the movieclips name was, swap it for the picture movieclip name, or call your picture card!!!

    or its a path issue to your card movieclip

    attach it so we can see or fiddle around with path/names

  9. #9
    Junior Member
    Join Date
    Nov 2014
    Posts
    12
    excuse worked, the problem is that this way will not work, because when I click a color and want to change only one side of the image, only when an image button above the "card" the image does not appear

  10. #10
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    You lost me,

    I think you said it worked, and I believe it will only print whatever is inside of "card" movieclip

    i use CS6 so its no use attaching the *.fla either, unless you can save for CS6

  11. #11
    Junior Member
    Join Date
    Nov 2014
    Posts
    12
    the problem is that when I print the image on top of this card does not appear, and I wanted her also from printing.

    http://uploaddeimagens.com.br/imagen...ulo-png--10576

  12. #12
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    I suggest you attach all clips to be printed inside of "card" movieclip at the next highest depth, something like
    card.addChildAt(myClip,1);

    then add or remove stuff before printing
    Last edited by fruitbeard; 12-01-2014 at 01:25 PM.

  13. #13
    Junior Member
    Join Date
    Nov 2014
    Posts
    12
    I need to do a simulated color

    https://www.suvinil.com.br/SimuladorV2/
    Last edited by andre felipe; 12-01-2014 at 01:34 PM.

  14. #14
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Portuguese is not my languae, too much going on there for me, sorry.

    I thought you just wanted help with printing a movieclip.

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