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

全部博文(4)

文章存档

2008年(4)

我的朋友

分类:

2008-08-05 16:19:55

1./**
 *  Dispatched at the beginning of the component initialization sequence.
 *  The component is in a very raw state when this event is dispatched.
 *  Many components, such as the Button control, create internal child
 *  components to implement functionality; for example, the Button control
 *  creates an internal UITextField component to represent its label text.
 *  When Flex dispatches the preinitialize event,
 *  the children, including the internal children, of a component
 *  have not yet been created.
 *
 *  @eventType mx.events.FlexEvent.PREINITIALIZE
 */
[Event(name="preinitialize", type="mx.events.FlexEvent")]
在组件的初始化序列开始时发送一个名为preinitialize事件.当事件发送时,组件处于一个未加工的状态.
很多组件,像按钮控件,创建内部的孩子组件去实现功能;举个例子,按钮控件创建了一个内部的UITextField
组件来呈现它的标签内容.当Flex发送preinitialize事件时.组件的孩子,包括内部的孩子都还没有创建呢.
2./**
 *  Dispatched when the component is removed from a container as a content child
 *  by using the removeChild() or removeChildAt() method.
 *  If the component is removed from the container as a noncontent child by
 *  using the rawChildren.removeChild() or
 *  rawChildren.removeChildAt() method, the event is not dispatched.
 *
 *  @eventType mx.events.FlexEvent.REMOVE
 */
[Event(name="remove", type="mx.events.FlexEvent")]
当组件做为一个内容孩子从一个容器里被移走时,发送一个名为remove的事件.如果一个组件做为一个非内容孩子从一个容器里通过rawChildren.removeChild()或rawChildren.removeChildAt()被移走时,这个事件是不会被发送的.
3./**
 *  Dispatched when the component is resized.
 *
 * 

You can resize the component by setting the width or
 *  height property, by calling the setActualSize()
 *  method, or by setting one of
 *  the following properties either on the component or on other components
 *  such that the LayoutManager needs to change the width or
 *  height properties of the component:


 *
 * 

     *   
  • minWidth

  •  *   
  • minHeight

  •  *   
  • maxWidth

  •  *   
  • maxHeight

  •  *   
  • explicitWidth

  •  *   
  • explicitHeight

  •  * 

 *
 * 

The resize event is not
 *  dispatched until after the property changes.


 *
 *  @eventType mx.events.ResizeEvent.RESIZE
 */
[Event(name="resize", type="mx.events.ResizeEvent")]
当组件调整大小时发送一个名为resize的事件
你可以调整组件的大小通过设置属性width或height,通过调用setActualSize()方法或通过在任一组件上设置以下属性之一来设置.以上的,LayoutManager需要改变组件的width 或height属性.
resize事件直到这些属性改变后才会被发送.
4./**
 *  Dispatched when an object's state changes from invisible to visible.
 *
 *  @eventType mx.events.FlexEvent.SHOW
 */
[Event(name="show", type="mx.events.FlexEvent")]
当一个对象的状态改变,从不可见到可见时,一个名为show的事件被发送了.
5./**
 *  Dispatched from a component opened using the PopUpManager
 *  when the user clicks outside it.
 *
 *  @eventType mx.events.FlexMouseEvent.MOUSE_DOWN_OUTSIDE
 */
[Event(name="mouseDownOutside", type="mx.events.FlexMouseEvent")]
当用户点击了一个用PopUpManager弹出的组件的外面时,发送一个名为mouseDownOutside的事件
6./**
 *  Dispatched from a component opened using the PopUpManager
 *  when the user scrolls the mouse wheel outside it.
 *
 *  @eventType mx.events.FlexMouseEvent.MOUSE_WHEEL_OUTSIDE
 */
[Event(name="mouseWheelOutside", type="mx.events.FlexMouseEvent")]
当用户滚动鼠标的轮子在用PopUpManager打开的组件时发送一个名为mouseWheelOutside的事件
7./**
 *  Dispatched when values are changed programmatically
 *  or by user interaction.
 *
 * 

Because a programmatic change triggers this event, make sure
 *  that any valueCommit event handler does not change
 *  a value that causes another valueCommit event.
 *  For example, do not change a control's dataProvider
 *  property in a valueCommit event handler.


 *
 *  @eventType mx.events.FlexEvent.VALUE_COMMIT
 */
[Event(name="valueCommit", type="mx.events.FlexEvent")]
当值被程序化的或通过和用户交互来改变时发送一个名为valueCommit的事件.
8./**
 *  Dispatched when a component is monitored by a Validator
 *  and the validation failed.
 *
 *  @eventType mx.events.FlexEvent.INVALID
 */
[Event(name="invalid", type="mx.events.FlexEvent")]
当一个组件被一个验证器监视并验证失败时,发送一个名为invalid的事件.
9.
/**
 *  Dispatched when a component is monitored by a Validator
 *  and the validation succeeded.
 *
 *  @eventType mx.events.FlexEvent.VALID
 */
[Event(name="valid", type="mx.events.FlexEvent")]
当一个组件被一个验证器监视并验证成功时,发送一个名为valid的事件.
10./**
 *  Dispatched by a component when the user moves the mouse over the component
 *  during a drag operation.
 *
 * 

In order to be a valid drop target, you must define a handler
 *  for this event.
 *  In the handler, you can change the appearance of the drop target
 *  to provide visual feedback to the user that the component can accept
 *  the drag.
 *  For example, you could draw a border around the drop target,
 *  or give focus to the drop target.


 *
 * 

If you want to accept the drag, you must call the
 *  DragManager.acceptDragDrop() method. If you don't
 *  call acceptDragDrop(), you will not get any of the
 *  other drag events.


 *
 * 

The value of the action property is always
 *  DragManager.MOVE, even if you are doing a copy.
 *  This is because the dragEnter event occurs before
 *  the control recognizes that the Control key is pressed to signal a copy.
 *  The action property of the event object for the
 *  dragOver event does contain a value that signifies the type of
 *  drag operation.


 *
 * 

You may change the type of drag action by calling the
 *  DragManager.showFeedback() method.


 *
 *  @see mx.managers.DragManager
 *
 *  @eventType mx.events.DragEvent.DRAG_ENTER
 */
[Event(name="dragEnter", type="mx.events.DragEvent")]
当用户在一个拖拉操作其间移动鼠标越过一个组件上时发送一个名为dragEnter的事件.
为了成为一个合法的拖拉目标,你必须为这个事件定义一个处理者.
在这个处理者里,你可以改变这个拖拉目标的外观来提供一个可视化的反馈给读者来表明这个组件已经接受拖拉.
举个例子,你可以在拖拉目标的周围画一个边框,并给其设置焦点.
如果你想接受拖拉,你必须调用DragManager.acceptDragDrop()方法.如果你调用acceptDragDrop()方法,你将不能再接受任何其他拖拉的事件.
这个ACTION属性的值经常是DragManager.MOVE,即使你做了一个copy.这是因为dragEnter事件是在控制器承认ctrl被按下,并发信号通知COPY前发生的.
DragOver事件的属性ACTION不包含一个能表示拖拉操作类型的值.
你可以通过调用DragManager.showFeedback()这个方法来改变拖拉动作的类型.
11./**
 *  Dispatched by a component when the user moves the mouse while over the component
 *  during a drag operation.
 *
 * 

In the handler, you can change the appearance of the drop target
 *  to provide visual feedback to the user that the component can accept
 *  the drag.
 *  For example, you could draw a border around the drop target,
 *  or give focus to the drop target.


 *
 * 

You should handle this event to perform additional logic
 *  before allowing the drop, such as dropping data to various locations
 *  in the drop target, reading keyboard input to determine if the
 *  drag-and-drop action is a move or copy of the drag data, or providing
 *  different types of visual feedback based on the type of drag-and-drop
 *  action.


 *
 * 

You may also change the type of drag action by changing the
 *  DragManager.showFeedback() method.
 *  The default value of the action property is
 *  DragManager.MOVE.


 *
 *  @see mx.managers.DragManager
 *
 *  @eventType mx.events.DragEvent.DRAG_OVER
 */
[Event(name="dragOver", type="mx.events.DragEvent")]
组件发送一个名为dragOver的事件在一个拖拉操作其间当用户移动鼠标正在越过组件时.
在这个处理者里,你可以改变这个拖拉目标的外观来提供一个可视化的反馈给读者来表明这个组件已经接受拖拉.
你应该处理这个事件来执行额外的逻辑在运行拖拉前,就像拖拉数据到拖拉目标的各种不同的位置里,阅读键盘的输入来决定拖拉的动作是要移动还是复制拖拉数据或在拖拉动作类型的基础上提供各种不同的可视化反馈.
你可以通过改变DragManager.showFeedbakc()方法来改变拖拉动作的类型.属性ACTION的默认值是DragManager.MOVE;
12./**
 *  Dispatched by the component when the user drags outside the component,
 *  but does not drop the data onto the target.
 *
 * 

You use this event to restore the drop target to its normal appearance
 *  if you modified its appearance as part of handling the
 *  dragEnter or dragOver event.


 *
 *  @eventType mx.events.DragEvent.DRAG_EXIT
 */
[Event(name="dragExit", type="mx.events.DragEvent")]
当用户拖拉组件到外部但没有拖放数据到目标时,会发送一个时间叫dragExit.
你可以用这个事件去恢复这个拖拉目标到它的普通表现形式,如果你修改了它的外观在处理事件dragEvent和dragOver时,
13./**
 *  Dispatched by the drop target when the user releases the mouse over it.
 *
 * 

You use this event handler to add the drag data to the drop target.


 *
 *  @eventType mx.events.DragEvent.DRAG_DROP
 */
[Event(name="dragDrop", type="mx.events.DragEvent")]
当用户释放在鼠标在经过他时,由拖放的目标来发送一个名为dragDrop的事件
你用这个事件来处理增加拖拉数据到拖放目标上.
14./**
 *  Dispatched by the drag initiator (the component that is the source
 *  of the data being dragged) when the drag operation completes,
 *  either when you drop the dragged data onto a drop target or when you end
 *  the drag-and-drop operation without performing a drop.
 *
 * 

You can use this event to perform any final cleanup
 *  of the drag-and-drop operation.
 *  For example, if you drag a List control item from one list to another,
 *  you can delete the List control item from the source if you no longer
 *  need it.


 *
 *  @eventType mx.events.DragEvent.DRAG_COMPLETE
 */
[Event(name="dragComplete", type="mx.events.DragEvent")]
要么是当你把拖拉数据拖放到目标上,要么当你结束一个拖拉放的操作在没执行一个拖放时拖拉的操作完成,由拖拉的发起人发送一个名为dragComplete的事件(这个发起人就是被拖拉的数据的源)
你可以用这个事件来执行任何最终的拖拉放的清空操作.
举个例子,如果你拖拉一个List控件中的一项到另一个控件,你可以删除ITEM项从源List控件那里如果你不再需要它的话.
15./**
 *  Dispatched just before an effect starts.
 *
 * 

The effect does not start changing any visuals
 *  until after this event is fired.


 *
 *  @eventType mx.events.EffectEvent.EFFECT_START
 */
[Event(name="effectStart", type="mx.events.EffectEvent")]
就在效果开始前发送一个名为effectStart的事件.
这个事件不会改变任何可视直到事件被燃起
16./**
 *  Dispatched after an effect ends.
 *
 * 

The effect will have made the last set of visual changes
 *  before this event is fired, but those changes will not have
 *  been rendered on the screen.
 *  Thus, you might have to use the callLater() method
 *  to delay any other changes that you want to make until after the
 *  changes have been rendered onscreen.


 *
 *  @eventType mx.events.EffectEvent.EFFECT_END
 */
[Event(name="effectEnd", type="mx.events.EffectEvent")]
当一个效果结束时发送一个名为effectEnd的事件
在这个事件被燃起前,这个效果会执行最后一套的可视化改变,但这些改变还没有呈现到屏幕上.
因此,你也许不得不使用callLater()方法去延迟那些你想要的改变直到这些改变已经呈现在屏幕上.
17./**
 *  Dispatched after the currentState property changes,
 *  but before the view state changes.
 *
 *  @eventType mx.events.StateChangeEvent.CURRENT_STATE_CHANGING
 */
[Event(name="currentStateChanging", type="mx.events.StateChangeEvent")]
在属性currentState改变后,但在界面状态改变前发送一个名为currentStateChanging的事件.
18./**
 *  Dispatched after the view state has changed.
 *
 *  @eventType mx.events.StateChangeEvent.CURRENT_STATE_CHANGE
 */
[Event(name="currentStateChange", type="mx.events.StateChangeEvent")]
在界面状态发生改变后发送一个名为currentStateChange的事件
19./**
 *  Dispatched after the component has returned to the root view state.
 *
 *  @eventType mx.events.FlexEvent.ENTER_STATE
 */
[Event(name="enterState", type="mx.events.FlexEvent")]
在组件回到了根界面状态后发送一个名为enterState的事件
20./**
 *  Dispatched before the component exits from the root view state.
 *
 *  @eventType mx.events.FlexEvent.EXIT_STATE
 */
[Event(name="exitState", type="mx.events.FlexEvent")]
组件离开根界面状态前发送一个名为exitState的事件
 

 
 
 
阅读(805) | 评论(0) | 转发(0) |
0

上一篇:UIComponent研究(-)

下一篇:UIComponent研究(三)

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