[转] UIComponent的生命周期(life cycle)
来源:互联网 发布:windows汇编和普通汇编 编辑:程序博客网 时间:2024/05/01 21:57
转自 http://www.nshen.net/blog/article.asp?id=519
写flex组件,了解UIComponent的生命周期(life cycle)很重要,尤其是初始化(initialization)的过程很复杂,贴个文件可以很容易看清这个顺序
文件如下:
拖到舞台上发布就可以看到trace信息了:
如果想详细的了解各个部分请看
本站推荐过的<Programing Flex 2>那本书的最后一章
或者在自带的帮助中找Creating and Extending Flex 3 Components / Creating ActionScriptComponents / Creating Advanced Visual Components in ActionScript
偶简单总结了一下
组件的life cycle包含3个阶段:initialization, update, destruction.
initialization阶段又包括construction部分, attachment部分,和initialization部分,直接看偶下边画的图吧
keeping in mind what invalidation methods cause a call to what validation method
invalidateProperties( ) commitProperties( )
invalidateSize( ) measure( )
invalidateDisplayList( ) updateDisplayList( )
commitProperties()
This method’s purpose is to commit any values typically set by
using a setter function. Often the commitProperties( ) method is as simple as calling
super.commitProperties( ) and setting the cached values:
measure( )
The purpose of this method is to perform measurement calculation and define sizing
information for the framework.
As a general rule, you will typically use the children’s width and
height properties to retrieve the size values of children that do not inherit from
UIComponent. For children that do inherit from UIComponent, you will want to use the
getExplicitOrMeasuredWidth( ) and getExplicitOrMeasuredHeight( ) methods.
updateDisplayList( ) 设置位置和大小
In the measure( ) validation method we retrieved the size, and in the
updateDisplayList( ) method we will set the size and position the children. When
positioning and sizing children, if a child does not inherit from UIComponent you will
want to use the x and y properties for positioning and the width and height properties
for sizing. If a child does inherit from UIComponent, you should use the
setActualSize(width,height) method for sizing and the move(x,y) method for
positioning.
- [转] UIComponent的生命周期(life cycle)
- UIComponent的生命周期(life cycle)
- UIComponent的生命周期(life cycle)
- UIComponent的生命周期(life cycle)--转自N神的日志
- UIComponent之life cycle
- Servlet的生命周期((life cycle)
- Servlet的生命周期((life cycle)
- Page类与Control类的生命周期(life cycle)比较总结[转]
- 软件发布的生命周期(software release life cycle)
- 软件生命周期(Systems Development Life Cycle )的六个阶段
- 软件发布生命周期 Software release life cycle
- Processes and Threads life cycle生命周期
- iOS Application Life Cycle 应用程序生命周期
- iOS Application Life Cycle 应用程序生命周期
- iOS Application Life Cycle 应用程序生命周期
- iOS Application Life Cycle 应用程序生命周期
- Android应用程序的Life Cycle
- Page类与Control类的生命周期(life cycle)比较总结
- ASP.NET页面生命周期描述
- javascript中Style之visibility与display的比较.
- 我知道怎么盗取他人的号的原理
- static的作用
- 基于Appfuse2开发模式下DAO层接口测试步骤
- [转] UIComponent的生命周期(life cycle)
- u盘编程技巧
- 禁忌搜索算法(TS)
- c#中使用存储过程
- C#类和接口及值类型和引用类型的区别
- 代理模式
- 用Doxygen写使用手册
- 12星座的眼神
- .net框架下的序列化应用