In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Xiaobian to share with you how to use MDI framework in Flex code specification, I hope you have gained something after reading this article, let's discuss it together!
Flex Code Specification
1. MDI Framework Use
1.1. Initialize parameter handling functions
Register window initialization event:
MessagesManager.getInstance().addEventListener(this.uid+MessageEvent.
CREATIONCOMPLETE_MESSAGE,messageHandler,false,0,true); specific reference: 4.4.5 code example;
1.2. Window Message Communication (Window Event)
◆ Message sending:
Just send the corresponding event (the type of event, usually write the module name first, then write the event type):
MessagesManager.getInstance().dispatchEvent(newEvent("moduleName_cmd"));
◆ Message reception:
Just listen for events in the window:
MessagesManager.getInstance().addEventListener("login_ok",
messageHandler,false,0,true);5.3. Release references when window closes
When the window closes, all defined references must be released, most importantly, external references held by this window and corresponding window events.
For example, write a removeHandler and put it in the removed event of the window to handle ();
/**
* Executed when removing modules
*/
privatefunctionremovedHandler(event:Event):void{ try{ if(event.target==this){//Empty all references to module definition //@TODO MessagesManager.getInstance().removeEventListener(this.uid+MessageEvent. CREATIONCOMPLETE_MESSAGE,messageHandler); } }catch(e:Error){ AlertExt.show(e.getStackTrace(),e.errorID+""); } }
2. Performance criteria in Flex code specification
2.1. deferred instantiation
For example, the navigation bar containers (ViewStack, Accordin, TabNavigator) in Flex have built-in deferred instantiation. Do not set creationPolicy="all" for controls;
2.2. MXML tag nesting levels
Minimize the number of nested containers, such as HBox, VBox, Canvas
Should be controlled within 3 layers, beyond the standard should find alternative layout scheme;
2.3. Common container redundancy to avoid
The following list provides examples of common container redundancies that should be avoided:
VBox containers in labels-Panel containers are VBox containers that support title bars, rounded edges, and other Panel styles. To lay out the child objects of a Panel as if they were in a VBox container, fill the labels of the controls directly; do not place controls in a VBox container. VBox containers are redundant packaging containers, and removing them removes another layer of unnecessary container nesting.
After reading this article, I believe you have a certain understanding of "how to use MDI framework in Flex code specification". If you want to know more about it, please pay attention to the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.