Question

I am using flash External Interface to send media files from javascript to actionscript. However, sending the binary as a string causes unexpected problems. Presence of certain characters in the binary file causes the string to be received as null. One such character was ﷡ .

I tried using btoa() on the file but it failed with "invalid characters" within the js itself.

I have a flash application which need to make http calls with range request header. Since range header is not allowed in flash, I am using external interface on javascript but then stuck here.

Was it helpful?

Solution

Had to write a few scripts to do this job. They basically encode the javascript array buffer into ascii characters and then decode them in actionscript. I am not sure how efficient these are.

https://gist.github.com/vibhavsinha/11344013

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top