Want to push a hex value from a database to a myavatareditor element? It’s easy, here is an example:
Make sure $avatarid is the Hex code for your avatar. PHP example included here..
<script type= "text/javascript" > //<![CDATA[ var avatarvalue = "<?= $avatarid ?>" ; var avatarURL = "myavatarcharacter.swf?avatar=" + avatarvalue; swfobject.embedSWF(avatarURL, "avatarSWFContainer" , "160" , "200" , "10.0.0" , null , {hosted: true }); function setFacialFeature(){ var avatarSWF = document.getElementById( 'avatarSWFContainer' ); avatarSWF.draw(); } //]]> </script> |