I'm looking to draw a VGroup (that contains several elements like other groups and images) into a BitmapData, then to encode it into a ByteArray and to send this via a POST.
I'm using widgets, lets say my VGroup is built by a widget A and I get it in my widget B. I use a singleton to transfer the data. I don't know if my transfer is good, but when I get it back in widet B I can display it, and the display is OK. My VGroup has a fixed height and width, here's the code :
var printBox:VGroup = SharedData.getInstance()._sharedData["Shared_EligibilitePopupWidget_vgroup"];
this.addChild(printBox);
var m:Matrix = new Matrix();
var bd:BitmapData = new BitmapData(printBox.width, printBox.height);
bd.draw(printBox, m);
var ba:ByteArray = (new PNGEncoder()).encode(bd);
_fileRef = new FileReference();
_fileRef.save(ba, "test.png");
But when I look at the saved file, the print is blank, I have tried multiple things but still blank... I don't know what is wrong, the width ? the fact that I have created it in widget A ?
Looking for help, thks.