0 Replies Latest reply on Apr 21, 2010 8:10 AM by sleblang

    FB4: Create screenshot (bitmap) from loaded swf

    sleblang Level 1

      I am loading an external swf into my flex application using the SWF Loader. Once loaded, I would like to capture/copy the SWF into a bitmap and then unload the original swf. I only need/want to capture the image (1st frame) of the SWF as opposed to the having the SWF play in my Flex application. I have tried the following but doesn't work as it appears the entire swf is still loaded:

       

                          var bitmapData:BitmapData = new BitmapData( 125, 125 );
                          var swfLoader:SWFLoader = new SWFLoader()
                          swfLoader.source = data.asset_location
      
                          bitmapData.draw( IBitmapDrawable( swfLoader ));
                          swfBitmap = new Bitmap( bitmapData );
                          swfLoader.source = swfBitmap;
                          addElement( swfLoader )
      

       

      I have also tried loading the external swf using Loader and then upon completion executing the bitmap code.

       

      Thanks for any and all replies.