-
[Flash] How to print a credit size card with flash
Hello peeps!
I already have a flash form(1280x1024 stagesize fullscreen) that allows the users to type in their name/age and take a photo of their face. I was thinking is it possible to print out a card , for example "credit size CARD" with flash AS3? And of course, is it also possible to generate a unique barcode for every user and print it on the card? Any tutorials/tips out there please? I just started AS3 3 weeks ago so I think I need some sample codes to play with..
-
Originally Posted by celestale
Hello peeps!
I already have a flash form(1280x1024 stagesize fullscreen) that allows the users to type in their name/age and take a photo of their face. I was thinking is it possible to print out a card , for example "credit size CARD" with flash AS3? And of course, is it also possible to generate a unique barcode for every user and print it on the card? Any tutorials/tips out there please? I just started AS3 3 weeks ago so I think I need some sample codes to play with..
but how to make it unique?
-
Designer, Programmer, Musician
Just add a Print button and name it anything you like like "printButton" and place this code in the current frame in the main timeline:
PHP Code:
printBtn.addEventListener(MouseEvent.MOUSE_UP, printThis); function printThis(e:MouseEvent):void { var myPrintJob:PrintJob = new PrintJob(); myPrintJob.start(); myPrintJob.addPage(card); myPrintJob.send(); }
Where "card" is the name of the movieclip to be printed.
If you want to print the whole stage, use this in the printThis function:
PHP Code:
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);
var myPrintJob:PrintJob = new PrintJob(); myPrintJob.start(); myPrintJob.addPage(card); myPrintJob.send();
And for the "card size", you have to check how to convert the ID or Credit card size (inches) to pixeles
(Government Size 2 5/8" x 3 7/8")
And make the movieclip of the card that size.
Now...for the barcode thing, I've read something about barcodes in this forum, i will be reading about it and let you know.
Last edited by angelhdz; 01-25-2014 at 06:19 AM.
Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries
-
Originally Posted by angelhdz
Just add a Print button and name it anything you like like "printButton" and place this code in the current frame in the main timeline:
PHP Code:
printBtn.addEventListener(MouseEvent.MOUSE_UP, printThis); function printThis(e:MouseEvent):void { var myPrintJob:PrintJob = new PrintJob(); myPrintJob.start(); myPrintJob.addPage(card); myPrintJob.send(); }
Where "card" is the name of the movieclip to be printed.
If you want to print the whole stage, use this in the printThis function:
PHP Code:
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);
var myPrintJob:PrintJob = new PrintJob(); myPrintJob.start(); myPrintJob.addPage(card); myPrintJob.send();
And for the "card size", you have to check how to convert the ID or Credit card size (inches) to pixeles
(Government Size 2 5/8" x 3 7/8")
And make the movieclip of the card that size.
Now...for the barcode thing, I've read something about barcodes in this forum, i will be reading about it and let you know.
thanx for your kindness
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|