Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to test events during Flex initialization

2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "Flex initialization events how to test", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "Flex initialization events how to test" this article.

When a Flex component is created, it goes through four events: preinitialize, initialize, creationComplete, and updateComplete (the updateComplete event occurs in any case that changes the vision and is not unique to initialization).

Event testing during Flex initialization

When a Flex component is created, it goes through four events: preinitialize, initialize, creationComplete, and updateComplete (the updateComplete event occurs in any case that changes the vision and is not unique to initialization). I have an example here to detect the event-throwing order of each component tested during Flex initialization in nested and parallel cases.

Mx:Script > mx:Canvas > mx:Application >

Its output is:

1299 > eventTest0 preinitialize 1307 > > canv1 preinitialize 1310 > > btn1 preinitialize 1318 > > btn1 initialize 1319 > canv1 initialize 1320 > > btn2 preinitialize 1321 > > btn2 initialize 1321 > eventTest0 initialize [SWF] G:\ projects\ eventTest\ bin-debug\ eventTest.swf-588818 bytes after decompression 1387 > > btn1 creationComplete 1387 > > btn1 updateComplete 1387 > > canv1 creationComplete 1387 > > canv1 updateComplete 1388 > btn2 creationComplete 1388 > btn2 updateComplete 1388 > eventTest0 creationComplete 1388 > eventTest0 updateComplete

It looks a little confusing, but if you take a closer look, you can divide the process into two parts. Obviously, all the creationComplete and updateComplete took place during the second update, when the Flex component just did some setup and calculation and didn't draw anything on the canvas. In addition, there are some rules:

◆ for a single component, the order in which events are thrown when Flex is initialized is preinitialize,initialize,creationComplete

The two components of the ◆ nested relationship (such as Canvas and button1), preinitialize first outside then inside, initialize and creationComplete first inside then outside. It's just that creationComplete won't happen until the next update.

The two components of the ◆ parallel relationship (such as Canvas and button2), in the order within the mxml, only after the completion of the previous component initialize, the latter component will throw preinitialize.

These are all the contents of the article "how to test events during Flex initialization". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report