I need to encode a BitmapData object using JPegEncoder in an Adobe AIR application using JavaScript
I am trying to create a JpegEncoder object
var encoder=new window.runtime.mx.graphics.codec.JPEGEncoder()
and I get an error
TypeError: the result of the expression 'window.runtime.mx.graphics.codec.JPEGEncoder' [] is not a constructor.
I'm not sure if I did something wrong or it is not possible to access this class. This is my mxml header
<?xml version="1.0" encoding="utf-8" standalone="no"?> <application xmlns="http://ns.adobe.com/air/application/2.6">
Update: I found that you need to add a link to swf / swc, here is the smaple code for an application that uses rpc
<script type="application/x-shockwave-flash" src="lib/air/swf/framework/framework/library.swf"></script> <script type="application/x-shockwave-flash" src="lib/air/swf/framework/rpc/library.swf"></script>
I tried adding mx instead of rpc, but it does not work, I think if I need to deploy the mx.swc file with the application? (I think this is not necessary) or perhaps he cannot solve this problem the way
I solved this by deploying the framework.swf file using the application, but can this be done without it? Is this file present on client machines?
source share