In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail how the initialization order of FlexApplication is. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Flex components go through four events when they are built: preinitialize, initialize, creationComplete, and updateComplete, while the FlexApplication initialization order is preloader- > systemManager- > FlexApplicationstarted.
FlexApplication initialization order
The initialization order of FlexApplication is preloader- > systemManager- > FlexApplicationstarted...
◆ preinitialize
Triggered before all initialization, there is no definition of subcomponents, but variables of components can be referenced.
◆ initialize
Triggered when all subcomponents are generated, no components have been rendered at this point in time.
◆ reationComplete
The component definition is complete and the list is already being displayed.
◆ applicationComplete
All components are initialized and displayed.
First of all, it is introduced that SystemManager.SystemManager is the master of the Flex application, which controls the application window, Application instance, pop-up window, cursors, and manages the classes in ApplicationDomain. SystemManager is a FlashPlayer instantiated * * class, which stores the size and location information of the main application window and stores the traces of its sub-components such as floating pop-up window and modal window. Embedded fonts, styles and document objects can be obtained through SystemManager.
Custom visual components (subclasses of UIComponent) will not have a SystemManager assigned to them until they have called addChild (), which used to be Null. Therefore, do not use SystemManager. Exe in the constructor of custom visual components.
An event occurs when the Application object is created:
1. Instantiate Application object
2.FlexApplication initializes Application.systemManager
3.Application dispatches preinitialization events before the initialization process.
4. Call createChild (). At this point, all application components are created and all components' createChild () is called.
5.Application dispatches initialization events to indicate that all components have been initialized.
6. Dispatch creationComplete events
7.Application objects are added to the display list
8. Dispatch applicationComplete events
In most cases, we use to create application objects, but if we use ActionScript to create them, it is recommended not to create components in the constructor of application, but mainly for performance considerations in crateChildren functions.
Flash contains multiple frames on a timeline, while Flex's SWF contains only 2 frames. SystemManager, Preloader,DownloadProgressBar and a small number of utility classes are all in the * frame, and the rest, including application code / embedded resources, are all in the second frame. When FlashPlayer downloads SWF, as long as it receives enough data in the * * frame, it will instantiate the SystemManager, create the Preloader, and then create the DownloadProgressBar. These two objects will view the transmission process of the remaining bytes. When all the bytes of the frame have been transferred, the SystemManager sends enterFrame to the second frame, followed by other events. The * Application object dispatches the applicationComplete event.
Flex is an event-driven programming model. Whatever happens, there must be an event behind it. However, when developers see MXML for many times, it is difficult to realize the event flow and instantiated life cycle of an Xml tagged application. This is particularly confusing for HTML and Flash developers because their familiar ways are not at all similar to those of Flex. HTML instantiation is from top to bottom, and Flash execution runs frame by frame from Frame0. Flex is different.
From the beginning of learning Flex, we need to understand the event flow and the instantiation of MXML. I am very confused because it is difficult for me to understand what kind of event will be triggered or when it will be triggered. The key is to understand the basis of the event and personally observe the initialization of the event flow.
This is the end of this article on "what is the initialization order of FlexApplication?". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.
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.