flash - The class or interface com.adobe.images.JPGEncoder could not be loaded -


I am a total Flash novice, I have just installed Flash CS5 and have written the following code:

  Import Flash.display.BitmapData Import Flash.geom.Matrix import com.adobe.images.JPGEncoder; Import flash.net.FileReference; Import Flash. // Get the default camera // Change your default camera by using Flash Player settings Cam = Camera.get () // This event is also called when permission to access the local camera, the user is accepted or rejected by the camera is. OnStatus = function (e) {// if we are allowed (e.code = = "Camera.Unmuted") {// Start the application start ()} Other {System.showSettings (3)}} var Snapshot: BitmapData = New BitMap_Data (cam.width, cam.height); Function lasapshot () {var i: number = 1; Var fileRef: file reference = new file reference (); Snapshot.draw (cam, new matrix ()); //save Image(); Var encoder: jpgncoder = new JPGEncoder (); Var ba: Bytere = Encoder.xcode (bitmapdata); FileRef.save (left, "capture" + I + "jpg."); I ++; } // if there is no camera (cam == blank) {System.showSettings (3)} and {cam.setMode (1024, 768, 30); Cam.setQuality (10000,0); Output.attachVideo (cam); SetInterval (this, "takeSnapshot", 100); }  

On exporting SWF, I am getting the error:

  Class or interface com.adobe.images.JPGEncoder can not be loaded < / Code> 

I downloaded the as3corelibrary from the source source from code.google.com and placed the folder in root. Right now: \ wamp \ www \ com \ adobe \ images \ JPGEncoder.as

Is there a class line or do I have to set something?

It seems that you have inserted the code for the as3corelib in the root of the web server - to the source The path to keep in the original folder of your source will be Usually it is the same folder that contains your FLA. Copy the com folder into the same code that contains your FLA and then compile.

If you have taken your FLA in the same folder (the root of the web server), then it is a bad idea to get started - everybody will be able to access your source code.


Comments