How to create two UILoader that can be nested with each other and save the parent UILoader - as3
Hi all,
I am currently researching on the problem but I can't find any solution in the web.
Here is my problem:
I have two UILoader instance (loader_inner and loader_outer) I need to have loader_inner to be part of the loader_outer. I have also a button that will save all contents on loader_outer. Unluckily, when I trigger the save function, I only got a white image file. I was expecting that the contents of loader_outer (with loader_inner) to be saved also.
Note: background_1.jpg and rabbit.jpg are present in the directory. loader_outer and loader_inner where manually placed in the scene using UILoader component.

Here is a code snippet:
loader_inner.load(new URLRequest("background_1.jpg"));
loader_outer.load(new URLRequest("rabbit.jpg"));
loader_outer.addChild(loader_inner);
var bitmapData:BitmapData = new BitmapData(loader_outer.width,loader_outer.height);
bitmapData.draw(loader_outer);
var jpgencoder:JPGEncoder = new JPGEncoder(100);
var mybyte:ByteArray = jpgencoder.encode(bitmapData);
var myfile:FileReference = new FileReference();
myfile.save(mybyte,"test.jpg");
My expected output should be that background_1.jpg and rabbit.jpg should be saved in an image file and must be positioned like the ones placed in the scene.
Any ideas on this?
Thanks ahead.