Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual page 496

Programming actionscript 3.0
Table of Contents

Advertisement

import flash.geom.Rectangle;
public class PrintMultiplePages extends MovieClip
{
private var sheet1:Sprite;
private var sheet2:Sprite;
public function PrintMultiplePages():void
{
init();
printPages();
}
private function init():void
{
sheet1 = new Sprite();
createSheet(sheet1, "Once upon a time...", {x:10, y:50, width:80,
height:130});
sheet2 = new Sprite();
createSheet(sheet2, "There was a great story to tell, and it ended
quickly.\n\nThe end.", null);
}
private function createSheet(sheet:Sprite, str:String,
imgValue:Object):void
{
sheet.graphics.beginFill(0xEEEEEE);
sheet.graphics.lineStyle(1, 0x000000);
sheet.graphics.drawRect(0, 0, 100, 200);
sheet.graphics.endFill();
var txt:TextField = new TextField();
txt.height = 200;
txt.width = 100;
txt.wordWrap = true;
txt.text = str;
if (imgValue != null)
{
var img:Sprite = new Sprite();
img.graphics.beginFill(0xFFFFFF);
img.graphics.drawRect(imgValue.x, imgValue.y, imgValue.width,
imgValue.height);
img.graphics.endFill();
sheet.addChild(img);
}
sheet.addChild(txt);
}
private function printPages():void
496
Printing

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents