从Javascript ExternalInterface的通话读取时的ByteArray类型转换失败 [英] ByteArray Type Coercion failure when reading from Javascript ExternalInterface call
问题描述
我读从 ExternalInterface的
呼叫,该呼叫获得的ByteArray
从另一个<$ C ByteArray对象$ C> SWF 。究其原因, Javascript的
管道是因为的ByteArray
数据超过了 40K
的 LocalConnection类限
。
I am reading in a ByteArray object from an ExternalInterface
call which is obtaining the ByteArray
from another SWF
. The reason for the Javascript
conduit is because the ByteArray
data exceeds the 40k
limit of the LocalConnection class
.
我收到以下错误:
类型错误:错误#1034:类型强制失败:无法转换对象@ d6f48e1到flash.utils.ByteArray的
这一行的code:
swfBytes = ExternalInterface.call("getBytes", cacheIdx);
swfBytes是一个初始化的ByteArray对象。我相信我到的GetBytes()调用返回一个ByteArray对象,因为如果我跑了code以下行,我得到传递的字节数。
swfBytes is an initialized ByteArray object. I'm confident my call to getBytes() is returning a ByteArray object because if I run the following line of code, I get the number of bytes being passed.
ExternalInterface.call("getBytes", cacheIdx).bytesAvailable;
任何帮助是极大的AP preciated。
Any help is greatly appreciated.
推荐答案
谢谢!将数据分成40K块运作良好。现在我有另外一个问题,这是不能正确地关闭和重新使用的连接。采用了独特的连接字符串为每个连接的另一个回答问题建议。
Thanks! Splitting the data into 40k chunks worked well. Now I have another issue, which is the inability to properly close and reuse the connection. Another answered question suggested using a unique connection string for each connection.
这篇关于从Javascript ExternalInterface的通话读取时的ByteArray类型转换失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!