How to send a jpg image as ByteArray from as3 to javescript? And how to convert ByteArray to image in javascript?
A:
The JavaScript and DOM implementations of current web browsers don't really have good mechanisms for doing this sort of thing.
Your best bet is to have your AS3 return a DATA protocol URI with a base64-encoded version of the image. Modern browsers (IE8+, FF2+, etc) will accept a DATA URI as the SRC of an IMG tag and will render the image contained therein.
http://en.wikipedia.org/wiki/Data_URI_scheme
You'll have to have a AS3 expert explain how to turn an byte-array into a base64-encoded string, but it cannot be that hard.
EricLaw -MSFT-
2010-01-10 02:46:59
Not worked in <IE8 =(
Alex
2010-01-11 02:45:45
Indeed, that won't work in older browser versions. Without using a DATA URI, there's no other way to do this with the DOM itself.
EricLaw -MSFT-
2010-01-11 16:04:52
A:
hallvors
2010-04-12 15:26:44