Wednesday, April 8, 2009

Avatar Core Design Basics

I've updated the wiki for the Avatar Core framework with the basic design of the framework. Source code is available now, but I'm already making some changes to it that I'll probably upload within the next couple of days. I hope to spend a lot more time working with this next week when I have some more free time available.

3 comments:

Jonathan Maxwell said...

Excellent! There are so many uses for this ... watch this space

Jonathan

Ruairi said...

I'd like to integrate MyAvatar into my site but I'd like to streamline the export to PNG so I can ajax the image and xml up to my server. I'd like to have a simple thumbnail stored in a DB so they can use it on their profile page.

Could you expose the exportImageHandler so Flash creates an XHR request to a URL.

var swf = document.getElementById("avatarSWFContainer");
swf.onExport("/Upload/SavePNG.php");
swf.onSave("/Upload/SaveXML.php");

swf.setAvatarXML(xml);
.....and so on....


Is this possible?

senocular said...

Ruairi,

Exports currently occur entirely client-side within the editor SWF. That data, once saved, is not accessible by the SWF or the host HTML page. It goes directly from the SWF to the users harddrive where it's lost from the editor

If you want to control how that data is handled, the SWF (ActionScript) would need to be edited to facilitate that. XML could be sent to JavaScript since its just text, but the image data could not. It could be sent to the server, but not the JS. Once on the server, of course, you could get it through JS. Again, you'd have to implement this yourself.