var str:String = ""; //It won't be an empty string :) because it will a base64 encoded string of image.
var byteArr:ByteArray = Base64.converToByteArray(str); //Here you can use any ready made library to decode and convert the String into ByteArray. I used ready made library from here.
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded);
loader.loadBytes(byteArr);
function onImageLoaded(e:Event):void{
addChild(loader);
trace(loader.width + " : " + loader.height);
}
That's it. This can be useful where you can not load the image from server because you don't have the image but it's data as string. May this can be useful to some one :)
No comments:
Post a Comment