var bytes:ByteArray = new ByteArray(); bytes.writeUTFBytes( s ); for (var i:uint = 0; i<bytes.length; i++) { trace(bytes[i]); }