AS3 Printing String Problems

Hi there.

I’m having a major problem with printing a string. I was using this code which worked perfectly whenever the text (which varies in size) was less than 1 page long. But when there’s around 2 or 3 pages of text, it simply cuts off and only prints the first page of the text:

tPrintButtonI.addEventListener(MouseEvent.CLICK, tOnPrintI);

function tOnPrintI(e:MouseEvent):void
{    
    var tPrintNoteI:PrintJob = new PrintJob();
    
    if (tPrintNoteI.start())
    {
        try
        {
            var tPageSpriteI:Sprite = new Sprite;
            tNoteTextI.visible = true;
            tNoteTextI.x = -1000;
            tNoteTextI.y = -1000;
            tNoteTextI.wordWrap = true;
            tNoteTextI.width = 550;
            tNoteTextI.height = tPrintNoteI.paperHeight;
            tNoteTextI.text = tSummaryStringI;
            addChild(tPageSpriteI);
            tPageSpriteI.addChild(tNoteTextI);
            tPrintNoteI.addPage(tPageSpriteI);
        }
        catch(e:Error)
        {
            trace("There was an error");
        }
        
        tPrintNoteI.send();
        removeChild(tPageSpriteI);
        tNoteTextI.visible = false;
        tNoteTextI.x = 0;
        tNoteTextI.y = 0;
    }
}

tNoteTextI is an invisible text field on the stage, and tSummaryStringI is the (sometimes very long) string I want to print.

Any ideas on how to get it to dynamically create the correct number of print pages based on the string size would be hugely appreciated!

Thank you in advanced :pirate3: