Chinaunix首页 | 论坛 | 博客
  • 博客访问: 45809
  • 博文数量: 4
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 190
  • 用 户 组: 普通用户
  • 注册时间: 2006-06-25 16:56
文章分类

全部博文(4)

文章存档

2008年(4)

我的朋友

分类:

2008-08-05 12:00:52

今天看了下UIComponent.as觉得不错.把我看的稍微做个总结(部分):
1./**
 *  Dispatched when the component is added to a container as a content child
 *  by using the addChild() or addChildAt() method.
 *  If the component is added to the container as a noncontent child by
 *  using the rawChildren.addChild() or
 *  rawChildren.addChildAt() method, the event is not dispatched.
 *
 *  @eventType mx.events.FlexEvent.ADD
 */
[Event(name="add", type="mx.events.FlexEvent")]
当一个组件被做为一个内容孩子通过使用addChild或addChildAt方法加到一个容器时,发送事件(名为:add).
如果一个非内容孩子组件通过使用rawChildren.addChild()方法加到一个容器里.add事件是不会被发送的.
2./**
 *  Dispatched when the component has finished its construction,
 *  property processing, measuring, layout, and drawing.
 *
 * 

At this point, depending on its visible property,
 *  the component may not be visible even though it has been drawn.


 *
 *  @eventType mx.events.FlexEvent.CREATION_COMPLETE
 */
[Event(name="creationComplete", type="mx.events.FlexEvent")]
当一个组件完成了它的构造,属性的处理,测量,布局以及绘画时,这个名为creationComplete事件被发送.
按这点来说.它取决于它的可见属性,这个组件有可能是不可见的甚至它已经被画好了.
3./**
 *  Dispatched when an object has had its commitProperties(),
 *  measure(), and
 *  updateDisplayList() methods called (if needed).
 *
 * 

This is the last opportunity to alter the component before it is
 *  displayed. All properties have been committed and the component has
 *  been measured and layed out.


 *
 *  @eventType mx.events.FlexEvent.UPDATE_COMPLETE
 */
[Event(name="updateComplete", type="flash.events.Event")]
当一个对象已经调用了它的commitProperties(),measure(),updateDisplayList()方法时,它将发送名为updateComplete这个事件,它将这个是最后的机会去改变组件在它被显示之前.所有的属性都已经被提交并且该组件也已经被测量和布局了.
4./**
 *  Dispatched when an object's state changes from visible to invisible.
 *
 *  @eventType mx.events.FlexEvent.HIDE
 */
[Event(name="hide", type="mx.events.FlexEvent")]
当一个对象的状态改变从可视到不可视时,发送一个名为hide的事件
5./**
 *  Dispatched when the component has finished its construction
 *  and has all initialization properties set.
 *
 * 

After the initialization phase, properties are processed, the component
 *  is measured, laid out, and drawn, after which the
 *  creationComplete event is dispatched.


 *
 *  @eventType mx.events.FlexEvent.INITIALIZE
 */
[Event(name="initialize", type="mx.events.FlexEvent")]
当一个组件已经被构造了,并且设置了所有初始化属性时.发送名为initialize事件.在初始化阶段后,属性被处理,组件被测量,布局,被画,在这些后,名为creationComplete的事件被发送.
6.**
 *  Dispatched when the object has moved.
 *
 * 

You can move the component by setting the x
 *  or y properties, by calling the move()
 *  method, by setting one
 *  of the following properties either on the component or on other
 *  components such that the LayoutManager needs to change the
 *  x or y properties of the component:


 *
 * 

     *   
  • minWidth

  •  *   
  • minHeight

  •  *   
  • maxWidth

  •  *   
  • maxHeight

  •  *   
  • explicitWidth

  •  *   
  • explicitHeight

  •  * 

 *
 * 

When you call the move() method, the move
 *  event is dispatched before the method returns.
 *  In all other situations, the move event is not dispatched
 *  until after the property changes.


 *
 *  @eventType mx.events.MoveEvent.MOVE
 */
[Event(name="move", type="mx.events.MoveEvent")]
发送名为move的事件,当对象被移动时.你可以移动组件通过设置属性X或Y,通过调用move()方法,通过在组件或其他组件上设置以下属性就像布局管理器需要改变组件的X或Y属性.
当你调用move()方法时,在这个方法返回前move事件会被调用.在其他所有的形式里,move事件不会被发送直到属性改变了.
 
 
 
阅读(2366) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:UIComponent研究(二)

给主人留下些什么吧!~~