ExternalInterface で大量のデータを渡すとクラッシュする


How to Speed Up Flash 8′s ExternalInterface

ExternalInterface を使って、Flash から JavaScript へ 30000 文字前後の巨大な文字列を渡したら FlashPlayer 8 がクラッシュした。
ちなみに、FlashPlayer 9 では問題ない。

原因は、ExternalInterface が内部で使用している XML のパースらしい。
上部リンク先の解決策のように、データを分割したらクラッシュは無くなった。

ただし、

The other thing is you have to encode certain values (again because they are using XML and didn’t use CDATA sections

改行文字などをエンコードしなければ JavaScript が評価できる文字列にならないので注意。

ちなみに Brad Neuberg は Dojo の SharedObject ストレージを開発したエンジニアだそうだ。

カテゴリー: Flash, JavaScript   パーマリンク

コメントをどうぞ

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

*

次のHTML タグと属性が使えます: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>