전 초보자입니다. 난 그냥 플래시 CS5를 설치 한 다음 코드 작성 : SWF로 내보내기, 나는 오류가 점점 오전에com.adobe.images.JPGEncoder 클래스 또는 인터페이스를로드 할 수 없습니다.
import flash.display.BitmapData
import flash.geom.Matrix
import com.adobe.images.JPGEncoder;
import flash.net.FileReference;
import flash.utils.ByteArray;
//get the default camera
//change your Default camera using the Flash Player Settings.
cam=Camera.get()
//this event is called whenever permission to access the local camera, is accepted or denied by the user
cam.onStatus=function(e)
{
//if we are given permission
if(e.code == "Camera.Unmuted")
{
//start the application
initialize()
}
else
{
System.showSettings(3)
}
}
var snapshot:BitmapData=new BitmapData(cam.width,cam.height);
function takeSnapshot()
{
var i:Number=1;
var fileRef:FileReference = new FileReference();
snapshot.draw(cam,new Matrix());
//saveImage();
var encoder:JPGEncoder = new JPGEncoder();
var ba:ByteArray = encoder.encode(bitmapData);
fileRef.save(ba,"capture"+i+".jpg");
i++;
}
//if there are no Cameras
if(cam == null)
{
System.showSettings(3)
}
else
{
cam.setMode(1024, 768, 30);
cam.setQuality(10000,0);
output.attachVideo(cam);
setInterval(this,"takeSnapshot",100);
}
을 :
The class or interface com.adobe.images.JPGEncoder could not be loaded
나는 code.google에서 올바른 소스에서 as3corelibrary을 다운로드 한. co.kr 및 루트에 폴더를 배치했습니다. 지금은 C : \ wamp \ www \ com \ adobe \ images \ JPGEncoder.as입니다.
설정해야 할 클래스 경로가 있습니까?
오오 그렇습니다. 서버의 루트에 as3corelib을 넣었습니다. 그리고 FLA 파일은 다른 곳에 있습니다. 나는 네가 말한대로 나 자신을 바로 잡을 것이다. –