Flash tutorials
Home 3D (2) Actionscripting (66) Animation (108) Audio (4) Drawing (7) Full flash sites (4) Getting Started (15) Navigation (25) Special Effects (61) Text Effects (38)

Print document in flash!

15.3.2010, 11:47    Total views: 15779

Using this thoroughly explained, detailed flash lesson, I will explain to you how to print any document in flash. To make this lesson, you have to use action script code and print button. Let's start!


Example:



Step 1

Create a new flash document.



Step 2


Select the Text Tool (A) and type any text on flash stage.



Step 3

While the text is still selected, hit F8 key (Convert to Symbol) to convert it into a Movie Clip Symbol.



Step 4

While the new made Movie Clip (Print Text) is still selected, go to the Properties Panel below the stage. On the left side, You will find the Instance name input field there. Call this Movie Clip PrintText. See the picture below!



Step 5

Select the Text Tool (A) and Type PRINT somewhere on the stage. After that, create the Invisible Button over the PRINT text. See the picture below!



Step 6

Select the Selection Tool (V) and click once on the Invisible Button to select it. After that, go to the Action Script Panel (F9) and enter this code inside the actions panel:

on (release) {
  PrintFunc([PrintText]);
}

Step 7

Call the current layer Print Text. Double-click on its default name (Layer 1) to change it. Press Enter once you have typed in the new name!

Step 8

Select the first frame and go again to the AS panel (F9). Then, enter this code inside the actions panel:

function PrintFunc(WhatToPrint:Array) {
 var PrintQueue = new PrintJob();
 var PrintStart:Boolean = PrintQueue.start();
 if (PrintStart) {
  for (i=0; i<=WhatToPrint.length; i++) {
   PrintQueue.addPage(WhatToPrint[i]);
  }
  PrintQueue.send();
 }
}

We're done!

Please Enjoy!

Download source file (.fla)

Have questions about this tutorial?
Visit our friendly Community Forums!
Digg it! Add this tutorial to del.icio.us! Furl it! Add this tutorial to reddit! Spurl it! Add this tutorial to technorati!

Top tutorials

1. Advanced full flash site - Part 1
Total views: 310977

2. High-tech city animation
Total views: 274205

3. Water effect
Total views: 237451

4. Photo slide show
Total views: 221126

5. Special Picture Effect
Total views: 190885



Related links

dans le cadre de leur collection automne / hiver 2008 de la ngc, marque japonaise a ainsi une fois de plus a porter.ADIDAS TUBULAR WOMENils ont travaillé sur l'ensemble des trois pieces et # 8211; un sac fourre - tout, une valise et un porte - clés / carte de voyage.ils présentent une gamme de produits classiques.le fait qu'elles offrent a la plupart d'entre eux en orange est un bon contraste.  via honeyee.ADIDAS ORIGINALS NMDon peut s'attendre a une libération de ce produit dans les semaines a venir.ADIDAS TUBULAR SCHUHEla broderie artiste kimberly scola est parmi ceux qui participent a ce los angeles & # 8216; & # 8220; cette fete et # 8221; exposition,ADIDAS YEEZY BOOST 550 inaugurée vendredi dernier.ADIDAS EQUIPMENT 10a l'occasion de l'ouverture, en cas de scola a collaboré avec une tapisserie de 100 faux sacs fourre - tout.Adidas Adizero F50 FGces agréables rappels d'un événement,ADIDAS X PLR malheureusement, seulement deux jours de liaison.ADIDAS MESSI 16.3 ICles points saillants de & # 8220;StartAdidas Ultra Boost Uncaged cette fete et # 8221; et une liste de cas suivent l'artiste.ADIDAS ACE 16.3 TF