There are also the Base64Encoder and Base64Decoder classes that are
native to Flex.
import mx.utils.Base64Encoder;
import mx.utils.Base64Decoder;
private function base64Encode( data : ByteArray ) : String
{
var encoder : Base64Encoder = new Base64Encoder();
encoder.encodeBytes( data );
return encoder.flush();
}
private function base64Decide( string : String ) : ByteArray
{
var decoder : Base64Decoder = new Base64Decoder();
decoder.decode( string );
return decoder.flush();
}
_____________________________________
Andrew Trice
Cynergy Systems, Inc.
http://www.cynergysystems.com
Blog: http://www.cynergysystems.com/blogs/page/andrewtrice
Email: [EMAIL PROTECTED]
Office: 866-CYNERGY
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Harald Dehn
Sent: Wednesday, February 21, 2007 4:11 PM
To: [email protected]
Subject: AW: [flexcoders] Re: WebService & base64Binary
Sorry I forgot an example:
function base64encode(text:String):String {
var ba:ByteArrayEx = new ByteArrayEx();
ba.writeUTFBytes(text); // Fill ByteArray
with text
ba.base64encode();
ba.position = 0;
return ba.readUTFBytes(ba.length);
}
Harald
________________________________
Von: [email protected] [mailto:[EMAIL PROTECTED] Im
Auftrag von Harald Dehn
Gesendet: Mittwoch, 21. Februar 2007 22:06
An: [email protected]
Betreff: AW: [flexcoders] Re: WebService & base64Binary
We extended the ByteArray Class with a base64 decoder and encoder.
Harald
________________________________
Von: [email protected] [mailto:[EMAIL PROTECTED] Im
Auftrag von Cato Paus
Gesendet: Mittwoch, 21. Februar 2007 17:11
An: [email protected]
Betreff: [flexcoders] Re: WebService & base64Binary
Hi have you been on this page http://www.bytearray.org
<http://www.bytearray.org>
they are talking about some Base64.as ...
hope it helps
Cato Paus
--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, John Starfire <[EMAIL PROTECTED]> wrote:
>
> I don't really know how to deal with an image, encoded with
> base62Binary, that I receive from a webservice (e.g.
> http://www.webservicex.net/barcode.asmx
<http://www.webservicex.net/barcode.asmx> ).
>
> Is there a chance that I can decode it using Actionscript?
>
> Thanks for your help!
> //Jo
>