Environment communication
Printing from Flash
When you use Flash movies as a part of HTML page you may use browser's Print menus and current frame will be printed. However this technique is not efficient. When printing, browser considers Flash object simply as picture and it's resolution is not perfect, if you have dark background – it will consume a lot of ink, and Flash objects' size is not adjusted to the paper width as in traditional HTML.
It is much more efficient to print movie content from inside Flash file using Flash Player capabilities.
Fist you may wish to disable printing "everything and anything" from Flash Player. To do it you need to place this label in Properties Inspector for the first frame of the movie !#p - it will delete the Print command from Flash Player menu.
This technique will disable all frames from printing. If you still want one or several frames to be printed you need to put as a label #p. Only frames with this label will be printable. You don't need to place !#p label in this case.
You may explicitly tell Flash movie what content to print. Let's make this exercise.
- Create a new file and add some text, drawings or graphics.
- Add any movie symbol with graphics or text. Give it the instance name, for example "printable"
- Highlight this movie and enter this code in the movie event handler. It will make this instance invisible
onClipEvent(load) { this._visible = false; } - In the button event handler enter the following code. The first parameter of print action is the name of the movie instance, the second tells that it will be printed in the natural scale. If you change the second parameter to "bmax" it will occupy all the page.
on (release) { print("printable","bmovie"); }