Hi!
I have created a form in Flex 2.0.1 and when the user clicks the "Continue" button, I want to save the form as BitmapData, then encode into JPG data. However, I would like to make some of the components invisible first so they don't render, and disappear from the screen while this is happening. I would also like a busy cursor show while this is happening, as at the moment, the application looks like it freezes for a few seconds, then continues to the next page. The capture however does happen correctly, and the hidden components are not captured
The problem is that no matter what I do, the items stay on the screen while the BitmapDatais captured, and the busy cursor never displays. I have the following code:
The actual capturing of the bitmapdata etc works perfectly, and in the captured image itself, the controls set to visible = false are not captured. However, while the data is being captured, the items are still displayed on the screen, and the busy cursor never displays. While this is happening, it looks as though the app is doing nothing, as the user can still move the mouse around the screen, although they cannot interact.
Can anyone shed some light on how to achieve this? I just need, at the very least, an indication to the user that SOMETHING is going on behind the scenes.
Any help would be appreciated!!!
Cheers,
K.
I have created a form in Flex 2.0.1 and when the user clicks the "Continue" button, I want to save the form as BitmapData, then encode into JPG data. However, I would like to make some of the components invisible first so they don't render, and disappear from the screen while this is happening. I would also like a busy cursor show while this is happening, as at the moment, the application looks like it freezes for a few seconds, then continues to the next page. The capture however does happen correctly, and the hidden components are not captured
The problem is that no matter what I do, the items stay on the screen while the BitmapDatais captured, and the busy cursor never displays. I have the following code:
Code:
private function formComplete():void
{
sigLabel.visible = true;
placesignature.visible = false;
btnFormContinue.visible=false;
btnPrint.visible=false;
camAttached.visible=false;
btnResetSig.visible=false;
mx.managers.CursorManager.setBusyCursor();
FormSnapshot = new BitmapData(vboxHolder.width, vboxHolder.height, true);
FormSnapshot.draw(vboxHolder);
jpgForm = new ByteArray();
jpgForm = jpegEnc.encode(FormSnapshot);
sigLabel.visible = false;
placesignature.visible = true;
btnFormContinue.visible=true;
btnPrint.visible=true;
camAttached.visible=true;
btnResetSig.visible=true;
mx.managers.CursorManager.removeAllCursors();
}
The actual capturing of the bitmapdata etc works perfectly, and in the captured image itself, the controls set to visible = false are not captured. However, while the data is being captured, the items are still displayed on the screen, and the busy cursor never displays. While this is happening, it looks as though the app is doing nothing, as the user can still move the mouse around the screen, although they cannot interact.
Can anyone shed some light on how to achieve this? I just need, at the very least, an indication to the user that SOMETHING is going on behind the scenes.
Any help would be appreciated!!!
Cheers,
K.