# PrintJob timing out

**URL:** https://forum.kirupa.com/t/printjob-timing-out/231153
**Category:** flash
**Created:** [July 2, 2007, 3:13pm UTC](https://forum.kirupa.com/t/printjob-timing-out/231153 "2007-07-02T15:13:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ven](https://avatars.discourse-cdn.com/v4/letter/v/f9ae1b/32.png) [@ven](https://forum.kirupa.com/u/ven)
#### Post date: [July 2, 2007, 3:13pm UTC](https://forum.kirupa.com/t/printjob-timing-out/231153/1 "2007-07-02T15:13:45Z")

</div>

When printing several pages, I will get the Script timeout (Runtime Error #1502), since the loop that does the addPage()'s cant keep within the 15 seconds that flash will allow a loop to work.

I have searched and searched the web for a solution, but have just found small hints to how it can be solved.

For instance Aral Balkan has some hints **[here\*\* and \*\*[URL=“http://aralbalkan.com/252#comment-109”]here](http://aralbalkan.com/252#comment-107)**, where he suggests:

> 

The way I designed the print solution, it doesn’t time out: The trick is to use intervals instead of a regular loop. This complicates your implementation, of course, but, since it spans multiple frames, it doesn’t ever timeout.

and

> 

The trick is to prepare your pages _before_ you start the PrintJob.

Now, im pretty sure, judging by the date of this blogpost :sure:, that they are discussing AS 2.0, but i would guess that the techniques discussed should apply to AS 3.0 aswell, since the PrintJob haven’t changed much. But I tried adding pages by using a Timer object (intervals), but the PrintJob wont recieve the addPage(). Same thing happends if i try span it over several keyframes in Flash CS3.

This is starting to get really frustrating now, testing a gazillion approaches for over a week with nada result :deranged:

Any hints and approaches are welcome
