私は Flex フォーラムをあきらめ始めているので、ここに再投稿して状況を見ていきます。長年潜んでいて、初めてのポスター ;-)
私はステージ上でキーボードイベントをトラップし、フレームワークを介してカスタムイベントをディスパッチしています (Mate、これが重要な問題であることは知りません) が、スコープにかなり混乱しています。構造は次のとおりです。
--application (キーボード イベントをトラップし、カスタム イベントをディスパッチします
-- mainPanel (receives dispatched events but mainCalendar (a child element)
is null on debugging. Obviously if I try to call a public method on
mainCalendar it errors out, even though it's a child of mainPanel.
However, mainCalendar is NOT null IF I use
FlexGlobals.topLevelApplication.mainPanel.mainCalendar.
Outerdocument and parentDocument do not expose mainCalendar either, BTW
-- mainCalendar (a custom component inside mainPanel with public methods.
Creation policy is 'all' and it's visible and exists long before I
trap any keystrokes at the top level)
mainCalendar が mainPanel の子であるにも関わらず、mainPanel がカスタム イベントを受け取ったときに mainCalendar が範囲外である理由を誰かが説明してくれませんか。イベントを管理するためのより良い方法はありますか?
ありがとう