zoukankan      html  css  js  c++  java
  • 2010年8月26日周四_understanding Flex_componentsLifeCycle_7.5

    /*******************************************/

    //Component life cycle

    //2010年8月26日

    //version 2.0

    /*******************************************/

     

    Flex is an event-driven programming model. All Flex components undergo(vt.经历,遭受) the same instantiation life cycle during which Flex automatically calls component methods, dispatches events, and makes the component visible.

    Knowing the details of this life cycle will help you understand the sequence of events, which allows you to listen/wait for the proper events.

    Flex 是一个事件驱动编程模型。 所有的Flex组件经历相同的生命周期,在这个生命周期里面,Flex自动的调用组件的方法、分发事件并使控件可见。

    了解生命周期的细节有助于你理解事件的序列,它允许你侦听和等待合适的事件。

    Instantiation life cycle

    生命周期实例

    NOTE: After all components are created and drawn, the Application object dispatches an applicationComplete event. This is the last event dispatched during application startup.

    注意:所有组件创建和绘制后,Application对象分发一个ApplicationComplete事件。这是启动Application期间最后分发的一个事件。

    • preinitialize—An event  before initialization takes place. When Flex dispatches the preinitialize event, the children of a component, including internal children, have not yet been created. It is only useful in rare situations when you must set properties on a parent before the children are created.
    • 在初始化发生之前分发一个事件。 当Flex分发初始化事件,子组件,包括内部的子组件,都还没有被创建。当你必须在子组件创建之前设置一个父容器的属性情况下,这个事件是非常有用的,但是这样的情况是很少用到的。
    • childAdd—Dispatched on the parent container after all children have been initialized but before the component has been sized and processed for layout.
    • 添加子类:当所有的子类已经被出初始化,并且在组件调整大小和处理页面布局之前,在父容器中分发这个事件。
    • initialize—An event dispatched to alert initialization. At this time, all the component's children have been initialized but the component has not been fully processed or sized for layout.
    • 初始化:分发一个是事件警告初始化。 在这个时间,所有组件的子类都已经被初始化,但是组件还没有完全处理或者为布局调整大小。
    • creationComplete—Signals that the object is complete. This is called after Flex sets the visible property to true. The component has been sized and processed for layout and all properties are set. This event is dispatched only once.
    • creationComplete:标志着对象已经创建完成。 在Flex设置visible属性为true的时候调用这个事件。 组件大小已经调整好并且页面的布局也已经处理好,所有的属性被设置。这个事件仅仅分发一次。
    • updateComplete—Flex dispatches additional updateComplete events whenever the position, size, or other visual characteristic(特征) of the component changes and the component has been updated for display.
    • UpdataComplete:当组件的位置、大小或者组件的其他可视化的特征发生改变,并且组件已经为展示做了更新的时候,Flex就会分发这个额外的updateComplte事件。
    • load—Specific to the ArcGIS API for Flex. This applies to Map and Layer and consequently(因此) GraphicsLayer, ArcGISDynamicMapServiceLayer, ArcGISTiledMapServiceLayer, ArcGISImageServiceLayer and ArcIMSMapServiceLayer events. It is dispatched after its properties are set up but before the map is downloaded and displayed.
    • 加载:指定ArcGIS API for Flex。 她应用到map和图层中,因此,GraphicsLayer,ArcGISDynamicMapServiceLayer,ArcGISTiledMapServiceLayer,ArcGISImageServiceLayer,ArcIMSMapServiceLayer 事件。该事件在他们的属性设置好但是地图仍没有加载并显示的情况下分发。

    Tip

    When working with maps and layers, use the load event in the ArcGIS API for Flex instead of the generic creationComplete event. This will ensure that map properties such as extent and spatialReference are available.

    当和地图和图层一起工作,使用ArcGIS API for Flex中的Load事件取代generic creationComplete事件。 这将会保证,地图的属性是可以获取的,比如:地图的显示范围、空间参考系。

    More information

    For further information about the Flex life cycle, see the following:

    如果需要Flex 生命周期的进一步信息,请查看下面:

  • 相关阅读:
    随机性的控制
    856. 括号的分数
    376. 摆动序列(贪心算法)
    XGBoost 安装方法
    1405. 最长快乐字符串(贪心算法)
    1296. 划分数组为连续数字的集合(贪心算法)
    1353. 最多可以参加的会议数目(贪心算法)
    435. 无重叠区间(贪心算法)
    Array-数组-数据结构
    认识Redis和安装
  • 原文地址:https://www.cnblogs.com/xingchen/p/1808867.html
Copyright © 2011-2022 走看看