Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can create a container in AS3 and load your AS2 application into it. So you can use AS3 code in that container to save the image into your PC. Let me know if you need help regarding this.</p> <p>You need to deploy both the files in your release. AS3 swf will be your primary swf and AS2 swf will be loaded into it.</p> <p>// code</p> <p>package</p> <p>{</p> <pre><code>import asfiles.encoding.*; import flash.display.*; import flash.events.*; import flash.geom.*; import flash.net.*; import flash.utils.ByteArray; public class AS3Container extends MovieClip { public var myRequest:URLRequest; public var l:Loader; public function AS3Container() { myRequest = new URLRequest("scene.swf"); // load your AS2 swf l = new Loader(); l.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); l.load(myRequest); saveButton.enabled = false; saveButton.addEventListener(MouseEvent.CLICK, saveHandler); }// end function public function onComplete(event:Event) { this.addChild(l); l.width = stage.width; l.height = stage.height; saveButton.enabled = true; }// end function public function saveHandler(event:MouseEvent) : void { saveImage(l,"myImg.jpg"); }// end function public function saveImage(image:Loader, imageName:String) { var _rect:Rectangle = null; var _matrix:Matrix = null; trace(image.x+","+image.y); _rect = new Rectangle(image.width/2, image.height/2, image.width, image.height); var jpgSource:BitmapData = new BitmapData(image.width, image.height); jpgSource.draw(image, _matrix); jpgEncoder = new JPEGEncoder(100); var jpgStream:ByteArray = jpgEncoder.encode(jpgSource); var file:FileReference = new FileReference(); file.save( jpgStream, imageName ); } } </code></pre> <p>}</p> <p>The approach used in this link will help you to save using AS3 and PHP. <a href="http://subashflash.blogspot.in/2013/10/save-image-from-as2-project-using-as3.html" rel="nofollow">http://subashflash.blogspot.in/2013/10/save-image-from-as2-project-using-as3.html</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload