I'm creating a Flash/Actionscript tool that displays data and an image on the screen. I have an ASP page that retrieves the data and sends it back to the Flash tool. I need to encode the image, using base64, in VBscript within the ASP page, then decode it in actionscript.
Currently I'm using MSXML to do the encoding in the asp page. I then wrap the encoded string in some XML, then use Server.URLEncode(XMLString
) and write it out.
So, given this approach, what's the best way to decode the data into a byteArray for loading into an image on the stage? I'm currently trying to use, without success, com.dynamicflash.util, decodeToByteArray.
Is there a better way? The images could be fairly large. (They're photos people take using digital cameras so it's all over the map.)
'vbscript code in asp page
Dim dom: Set dom = CreateObject("MSXML2.DOMDocument.3.0")
Dim elem: Set elem = dom.appendChild(dom.createElement("root"))
elem.dataType = "bin.base64"
elem.nodeTypedValue = inData
Base64Encode = elem.Text
//AS3 Code snippet:
photoBA = Base64.decodeToByteArray(xml.BADGEREQUEST.PHOTO);