This is the code I'm using to create the JPG:
                public function createJPG(spr:Sprite, n:Number,
fileName:String):void {
                        var jpgSource:BitmapData = new BitmapData (spr.width, 
spr.height);
                        jpgSource.draw(spr);
                        var jpgEncoder:JPGEncoder = new JPGEncoder(n);
                        var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);

                        var header:URLRequestHeader = new URLRequestHeader 
("Content-type",
"application/octet-stream");

                        //Make sure to use the correct path to 
jpg_encoder_download.php
                        var jpgURLRequest:URLRequest = new URLRequest 
(Comun._URL_+"/php/
download.php?name=" + fileName + ".jpg");
                        jpgURLRequest.requestHeaders.push(header);
                        jpgURLRequest.method = URLRequestMethod.POST;
                        jpgURLRequest.data = jpgStream;

                        var loader:URLLoader = new URLLoader();
                        navigateToURL(jpgURLRequest, "_blank");
                }

Spr is the view. Thanks.

On 10 jun, 08:40, Jose <[email protected]> wrote:
> No luck,
> I am doing the project directly in AS3 with "Flash burrito" I can not
> use Flex components. Is there some kind of hack?. Thanks.
>
> On 10 jun, 01:54, binarydb <[email protected]> wrote:
>
>
>
>
>
>
>
> > If you develop with Flex and have created an Away3d flex component,
> > you could use ImageSnapshot.captureImage to capture the byteArray of
> > the UIComponent, then fileReference to save off to a file.  Obviously
> > this only works if you're on the Flex side of the fence.
>
> > On Jun 9, 9:22 am, Jose <[email protected]> wrote:
>
> > > Hello,
> > > I'm trying to save what I see on screen to a jpeg file. I tried
> > > capturing the View as a Sprite, but the result is a blank file. There
> > > is some method to render directly to a file?. Thanks.

Reply via email to