Делаю скриншонт с камеры и хочу сохранить его на сервер в формате jpg.
Делаю так:

Код AS3:
Urequest = new URLRequest("http://www.mysite.ru/upload.php");
var imgcontainer:BitmapData = new BitmapData(320,240);
var image:Bitmap = new Bitmap(imgcontainer);
var scaleMatrix:Matrix = new Matrix()
scaleMatrix.scale(2,2)
imgcontainer.draw(MyCamScreenshot,scaleMatrix);
var jpg:JPGEncoder = new JPGEncoder(100);
var ba:ByteArray = jpg.encode(image);
var file:FileReference = FileReference(ba);
file.upload(uploadURL);
компилятор ругается:
Цитата:
|
1067: Implicit coercion of a value of type flash.display:Bitmap to an unrelated type flash.display:BitmapData.
|
или, если я передаю image в FileReference:
Цитата:
|
Type Coercion failed: cannot convert flash.display::Bitmap@1eebc9d1 to flash.net.FileReference.
|
Пожалуйста, подскажите, что я делаю нетак?