Hello all,

I'm having a bit of difficulty.

I've got a VBox component that is a combination of mxml declared 
components and objects added at runtime.  I need to page this for 
printing.  So I've created a script class that I pass the Container 
and the desired page lenght to.  I return an array of VBox's 
representing the individual pages that will be added to the print 
job for printing.

The issue I'm having.

I get an error #2006 (The supplied index is out of bounds) when I 
add the components to the output VBox's.  I can iterate through the 
children in the following way and print them all out fine.

    for(var j:int=0;j<page.numChildren;j++)
    {
        trace(page.getChildAt(j));
    }

But when I try to add them to another VBox as follows I get the 
error after it's added half the elements.

    for(var i:int=0;i<page.numChildren;i++)
    {           
        var child:DisplayObject = page.getChildAt(i); 
                                
        if(iTotalHeight + child.height > pageHeight)
        {
            aRet.push(vbTemp);
            vbTemp = new VBox();
            iTotalHeight = 0;
        }
        vbTemp.addChildAt(child, i);
        iTotalHeight += child.height;
     }

Anyone have any ideas?

Thanks
Kent





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to