I have a number of items I add to the stage dynamically.
These are called flexShapeXXX where xxx is typically a unique ID.
Now I have created a component to store them in for printing, that I can treat as a virtual page so I can lay out stuff for printing.
This looks like this:
<?xml version="1.0"?>
<!-- myComponents\MyPrintView.mxml -->
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
backgroundColor="#FFFFFF"
height="300" width="500"
paddingTop="50" paddingLeft="50" paddingRight="50">
</mx:VBox>
Now so far so good I then take my little print are vbox component:
var formPrintView:MyPrintView = new MyPrintView();
formPrintView.width = printJob.pageWidth - 50;
formPrintView.height = printJob.pageHeight - 50;
addElement(formPrintView);
This works fine it add a nice space to work in.
Now I want to be able to do something like this:
formPrintView.addElement(dashPreview["flexShape" + TheID]);
printJob.addObject(formPrintView);
That part fails.
So my question is how do I addelements from the stage via dynamic names. So that I may print them.
Please and thank you for any help you can offer.
Craig