Use systemManager instead of application. Alex Harui Flex SDK Developer Adobe Systems Inc.<http://www.adobe.com/> Blog: http://blogs.adobe.com/aharui
From: [email protected] [mailto:[email protected]] On Behalf Of shafram Sent: Monday, October 26, 2009 1:31 PM To: [email protected] Subject: [flexcoders] ImageSnapshot and PopUpManager Hi, I have an application that has several windows that were created using the PopUpManager. I would like the user to be able to take a screenshot of the the app so I am using the ImageSnapshot class. The application is being captured but none of the pop up windows are showing up. Is there any way I can achieve this? I have attached an example of the problem. You will need to ensure that the project is set to require Flash Player Version 10.0 in the flex compiler options. To see the problem click on 'Pop up box' then click on 'Capture Image' Thanks in advance <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ import mx.graphi! cs.codec.PNGEncoder; import mx.graphics.ImageSnapshot; import mx.managers.PopUpManager; import mx.containers.TitleWindow; import flash.net.FileReference; private var titleWindow : TitleWindow; private function captureImage() : void{ var sn : ImageSnapshot; &nbs! p; sn = ImageSnapshot.captureImag! e(f orm,100,new PNGEncoder()); var file:FileReference = new FileReference(); file.save(sn.data, "captured.png"); } private function showPopUp() : void { if (titleWindow == null) { ! titleWindow = TitleWindow(PopUpManager.createPopUp(this.form,TitleWindow,false)); titleWindow.height = 115; titleWindow.width = this.form.width / 2; titleWindow.title = "My title window " + new Date(); PopUpManager.centerPopUp(titleWindow); } &nb! sp; else ! ; & nbsp; { PopUpManager.removePopUp(titleWindow); titleWindow = null; } } ]]> </mx:Script> <mx:VBox id="form"> <mx:Button label="Capture Image" click="captureImage();" /> <mx:TextArea id="txtBox" width="800" height="600" /> ! ; <mx:HRule/> <mx:Button label="Pop up box" click="showPopUp();" /> </mx:VBox> </mx:Application>

