2k visitas
Convert ByteArray to string or XML
When dealing with XML files in Flash, there are a lot of situations in which you need to convert a ByteArray to string or to XML. This is the easiest way to do it:
ActionScript
- // To String
- var string:String = byteArray.readUTFBytes(byteArray.length);
- // To XML
- var xml:XML = new XML(byteArray.readUTFBytes(byteArray.length));
Enviado por miguelSantirso hace about 1 year — modificado por última vez hace less than a minute