I wrote a piece of AS3 code that takes a base64 Encoded image from a piece of xml (jabber vcard stanza) and puts it on the stage.Because the mx.utils.Base64Encoder package is still undocumented (or not implemented yet ?) I used one I found at http://blog.jasonnussbaum.com/
I’m also still figuring out the whole E4X so I cheated a bit and removed the namespace xmlns=”vcard-temp” from the vCard tag.
[ Update: namespace� now works, so the cheat is gone.]
Basically you decode the Base64 Encoded String and copy it into a byteArray.
I use a loop to go through every char of the string en use writeByte to add it to the ByteArray, but maybe there’s a better/easier way.
You then use a Loader object to load in the byteArray you just created. Because the Loader object inherits from flash.display.DisplayObject you add it straight to the Stage using addChild.
Download example (includes Base64 class)
Hello World,
My name is Patrick Gutlich, I’m an 35 year old Interaction Designer / Developer from the Netherlands. After visiting Spark Europe last week I decided the time was right to start my own blog. So here it is!.
I’ll be posting about things like Interface Design, Flash, AMFPHP, Jabber and basically antything else that comes to mind.
Once I find a decent spam-proof commenting plugin, I’ll turn comments on.
Grtz
Patrick