/ Published in: ActionScript 3
This snippet uses the as3corelib which you can download on this page:
http://code.google.com/p/as3corelib/
http://code.google.com/p/as3corelib/
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* I DID NOT WRITE THIS, GO TO ACTIONSNIPPET.COM for this. IT IS A KICK ASS SITE. */ import com.adobe.images.JPGEncoder; var jpgEncoder:JPGEncoder = new JPGEncoder(80); var file:FileReference = new FileReference(); var id:int = 0; var bit:BitmapData = new BitmapData(400, 400, false, 0x000000); addChild(new Bitmap(bit)); stage.addEventListener(MouseEvent.CLICK, onClick); function onClick(evt:MouseEvent):void{ // draw some perlin noise bit.perlinNoise(200,200, 2, Math.random()*100, true, false,0, true); //bit.draw(someClip); //bit.draw(someVideo); id++; file.save(jpgEncoder.encode(bit), "image_" +id+".jpg"); }