In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
This article refers to Adobe flex 4.6help, the purpose of writing is only for personal memory and experience.
In Flex 4 or above, visual components are divided into spark and halo. Spark uses the separation of component classes and skin classes to greatly improve the support for custom appearance, especially for the custom appearance of some sub-skin components that move to change the layout. There is no need for painstaking updateDisplay methods to rewrite components.
In fact, there is little difference in the life cycle between the two sets of components.
Spark components var btn:Button=new Button (); btn.label= "buttons"; var box:VGroup=new VGroup (); box.addElement (btn); Halo components var btn:Button=new Button (); btn.label= "buttons"; var box:VBox=new VBox (); box.addChild (btn)
1. Call the constructor
Var btn:Button=new Button ()
2. Set component properties
Btn.label= "button"
Setting a property may call the component's related failure methods, such as
InvalidateProperties,invalidateSize
InvalidateSkinState (spark SkinnableComponent components only), invalidateDisplayList
It is important to note that if the visual component is not added to the stage at this time, the nestLevlel of the component is 0, and LayoutManager will not add the component to the validation sequence even if the above invalid methods are called, that is, the related validation methods (commitProperties, measure, updateDisplayList) will not be executed on the next render event. Instead, after the visual component is added to the stage, when the nestLevel of UIComponent is reset, the updateCallbacks method is called, and the invalidation method of LayoutManager is called to add the visual component to the verification sequence, and the relevant verification method of the component is called in the next render event (or ENTER_FRAME event).
3. Add visual components to the stage
The spark component uses the addElement,Halo component and uses addChild.
4. Set the parent property of the component
5. Style settings of computing components
6. The component dispatches preinitialize events
7. The component calls the createChildren method
The Halo component creates a subcomponent in the createChildren method and listens for events related to the subcomponent.
While the spark SkinnableComponent component calls the validateSkinChange → in the createChildren method and then calls the attachSkin method, creates a skin in the attachSkin method, adds it to the component class display list, and then calls the findSkinParts method to loop the skin component in the skin instance, and calls the partAdded method with each skin part's id and the skin part instance object itself as parameters. Component developers generally add event listening to the skin part in the partAdded method. After the findSkinParts is completed, the invalidateSkinState method is called (this method only detects whether the skinStateIsDirty Boolean flag variable is true, otherwise it is set to true, and the invalidateProperties method is called)
8. Call the invalid method
InvalidateProperties,invalidateSize
InvalidateSkinState (spark SkinnableComponent components only), invalidateDisplayList
9. The component dispatches the initialize event, when the child component has been created, but has not yet been laid out and sized.
10. The parent container component dispatches elementAdd (spark) or childAdd (Halo) events
11. The parent container component dispatches initialize events
12. When the next render event of SystemManager (the true main class of the Flex program) is dispatched, the component calls the relevant verification methods, such as
CommitProperties,measure (if the display size value is set, it will not be called), updateDisplayList.
The commitProperties method of the spark SkinnableComponent component detects the skinStateIsDirty Boolean flag variable. If it is true, it calls the getCurrentSkinState method to get the visual state State that the skin should have, and then sets it to the currentState property of the skin.
13. If the invalid method is called again during the verification method call, the component's validation method will be called again in the next render event of SystemManager
14. In the last render event, after the verification method of the component (no invalid method is called again) is executed, set the component visible to true, and schedule the creationComplete event (only once when the component is created)
15. Dispatch updateComplete events. Each time the visual component updates the display of the component due to changes in layout, location, size, etc., the updateComplete event will be dispatched
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.