I have a little problem. Today i write the code for saving encoded jpeg image in to my MySQL DB, but after i load the image back in my as3 app, the image doesnt show properly, it seems like loader load just a few of the bytearray. Any ideas ? Thanks so much. Sorry for bad english ....
var jpgEncoder:JPGEncoder = new JPGEncoder();
var ba1:ByteArray = jpgEncoder.encode(bitmapData1);
var encoded1:String = Base64.encodeByteArray(ba1);
sendtoserver.addEventListener(MouseEvent.CLICK, sendData);
function sendData(evt:Event){
var myData:URLRequest = new URLRequest("xxxx/images.php");
myData.method = URLRequestMethod.POST;
var variables:URLVariables = new URLVariables();
variables.obrazek1 = encoded1;
myData.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.load(myData);
loader.addEventListener(Event.COMPLETE, completeHandler);
function completeHandler(event:Event):void{
var dekodovani1:String = loader.data.obrazek1;
var decoded1:ByteArray = Base64.decodeToByteArray(dekodovani1);
var loaderbyte:Loader = new Loader();
loaderbyte.loadBytes(decoded1);
addChild(loaderbyte);
}
}
the image - http://ift.tt/1If7QNK but its must be all over the stage and show correctly, if i decode without using mysql, it show correctly, in the mysql i use blob table
Aucun commentaire:
Enregistrer un commentaire