Print Multiple Pages

Hi,

I’m building a application where user creates pages with content and I’d like to give them option to print these pages. My pages are MovieClips that are inside another MovieClip. I’d like to iterate through all pages and add them to print job. I tried to use addPage() method of PrintJob class, but I don’t know how to iterate through these MovieClips. I tried for loop but I came to Implicit coertion error.

 
var pj:PrintJob = new PrintJob();
var pagesToPrint:uint = 0;
if (pj.start())
{
for (var f:Number = 0; f < stb.length; f++) {
var chld:MovieClip = layout.getChildAt(f); // this throws me an implicit coertion error
try
{
pj.addPage(chld);
pagesToPrint++;
}
catch (error:Error)
{
// Respond to error.
}
}
trace("sending to printer")
pj.send();
}

Thanks for your help.