Return to table of contents
In ApplicationUI.mxml (init()), you will find the following two lines:
// in ApplicationUI.mxml, in init() titleControls.addEventListener( "showHelp", showHelpScreen ); addEventListener( "close", closePanel );
This is a little bit strange. One uses titleControls as event listener, the other uses ApplicationUI. It turns out this is due to the bubbling of event.
// in TitleControls.mxml <mx:Button click="dispatchEvent( new Event('showHelp') )" />
// in EmployeeView.mxml <mx:Button id="closeBtn" click="dispatchEvent( new Event( Event.CLOSE, true ) )"/>
Note that the “true” argument in the second case. It allows the Event to bubble to the parent components (ApplicationUI). That’s why ApplicationUI can hear the event. If you add “true” argument in the TitleControls.mxml, you can also use ApplicationUI to listen to the event.
Receive email notification via email 博客有新内容通知我
Don't want to miss new papers in your field? Check out Stork we developed: ![]() |
专注医学生物类的论文润色 联系他们请用优惠码 STORK4,他们会给你折扣。 |