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: 15711

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: 310287

2. High-tech city animation
Total views: 272904

3. Water effect
Total views: 237059

4. Photo slide show
Total views: 220388

5. Special Picture Effect
Total views: 190723



Related links