BeInteractive!

kappa-lab さんのところのエントリ (TextField is not DisplayObjectContainer) でさらっと書かれているのですが、TextField.getImageReference で取得出来る Loader の parent の値が、DisplayObjectContainer を継承していないはずの TextField を返します。そして、この TextField に対して DisplayObjectContainer のいくつかのプロパティにアクセスしようとすると、FlashPlayer がクラッシュします。恐らく、違う型 (AVM2 で言う Traits) でプロパティ (メモリ) にアクセスしにいっているため、想定外の部分を読んでクラッシュしているのだと思います。

以下検証コード:

var tf:TextField = new TextField();
tf.htmlText = "<p>Image:</p><p<>img src='image.jpg' id='image'>";
addChild(tf);

var ref:Loader = tf.getImageReference('image') as Loader;

trace(ref.parent.mouseChildren); // クラッシュする

確認した環境:

  • Mac OSX 10.4.11
    • FlashPlayer r9.0.124 (Standalone Debugger)
    • Flash CS3 9.0

FlashPlayer crashed when acess mouseChildren of a parent property of Loader can get by TextField.getImageReference().

According to kappa-lab's article (TextField is not DisplayObjectContainer), A parent property of the Loader can get by TextField.getImageReference is TextField. TextField is not a subclass of DisplayObjectContainer. Then, if we access some properites defined by DisplayObjectContainer on this TextField, FlashPlayer will crash. In my thought, illegal type (Traits, in AMV2) is used when we access properties. So FlashPlayer reads the memory outside the range.

Sample code:

var tf:TextField = new TextField();
tf.htmlText = "<p>Image:</p><p<>img src='image.jpg' id='image'>";
addChild(tf);

var ref:Loader = tf.getImageReference('image') as Loader;

trace(ref.parent.mouseChildren); // Crash

System:

  • Mac OSX 10.4.11
    • FlashPlayer r9.0.124 (Standalone Debugger)
    • Flash CS3 9.0

この記事へのトラックバック

トラックバックはありません。

TrackBack URL:

http://www.be-interactive.org/trackback.php?id=406

この記事へのコメント

yossy wrote:
たぶん英語が酷過ぎるので誰かにリライトしてもらいたい。

コメント書き込み:

カテゴリ

タグ

アーカイブ