I updated this Base64 Encoder to work with ActionScript 3 for Flex 2.0 Beta 3.
New version:Â Base64.zip
Also, there’s this version, which is binary data oriented:
Note that I’ve only done rudimentary testing with these. Â It may not work perfectly.
I updated this Base64 Encoder to work with ActionScript 3 for Flex 2.0 Beta 3.
New version:Â Base64.zip
Also, there’s this version, which is binary data oriented:
Note that I’ve only done rudimentary testing with these. Â It may not work perfectly.
RSS feed for comments on this post.
| TrackBack URI
You can also bookmark
this on del.icio.us or check the cosmos
Cool. Thanks!
One question, though: doesn’t AS 3.0 have a native Base64 encoder?
Comment by Jason Nussbaum — May 25, 2006 @ 6:50 pm
Heh. I felt really stupid for a while, but I just checked the Actionscript 3.0 docs at the Adobe site, including the corelib documentation, and I can’t find anything that indicates native Base64 support in AS3.
Comment by jb — May 25, 2006 @ 9:21 pm
I’ve officially lost my marbles. I definitely saw that - it was there. Beta 1 or 2. Or alpha.
I have no idea where it’s gone.
So, ignore my question. Blame it on the lack of marbles.
Comment by Jason Nussbaum — May 26, 2006 @ 1:11 pm
Actually, I have discovered by looking at CoreLib that it is there in the code - (mx.util.Base64Encoder), but it is not in the documentation.
Comment by jb — May 26, 2006 @ 1:32 pm
Like I said, I know I’d seen it…and there were docs for it at one point in time, but they’re very gone now. Oh well.
Comment by Jason Nussbaum — August 2, 2006 @ 2:43 pm
thanks jb
Comment by markas read — December 8, 2006 @ 9:22 pm
How Can I display that Image on webpage. Can I bind to Image control? After Decoding?
Comment by Jason — January 16, 2007 @ 6:37 pm
Sorry, what do you mean?
Comment by jb — January 16, 2007 @ 7:07 pm
I used the Base64 encoder provided in the article, but the encoded string is not divisible by 4. All Base64 encoded strings should be divisible by 4 so this does not work when you encode and call a Java webservice, since it will complain that “java.lang.IllegalArgumentException: Length of Base64 encoded input string is not a multiple of 4.”
Comment by Vinod — June 14, 2007 @ 3:16 pm
Great, but I have a question. Why it is encoding (or decoding) the non-english letters wrong.
I input this string: “Mókamaki mizériája” and I recive this one after encoding and decoding: “Mkamaki mizrija”? I lost all my “special” characters…
Comment by SzyTamas — September 16, 2007 @ 3:15 pm
If you’re just base encoding strings, you can easily use Flex’s existing classes. Look to the encode, and flush methods. I mention it on my blog, but found the classes thanks to you !!!
Comment by LEE — October 11, 2007 @ 7:10 am