Flex 启动基本流程

  1. First, enough bytes for frame 1 are streamed down to the Flash Player.
  2. The Flash Player executes those bytes by creating a SystemManager instance.
  3. SystemManager instruct the Flash Player to stop at the end of frame 1.
  4. SystemManager then goes on to create the Preloader which creates the DownloadProgressBar control and pops that up on the client screen.
    1. The Preloader then starts tracking the rest of the bytes streaming in from the Flex SWF (or from external SWFs).
      Once all the bytes for the Flex framework and application code are in, the System Manager goes on to frame 2 and instantiates the Application instance.
    2. All RSLs and their associated classes are now loaded [into the ApplicationDomain]; note that the load order is in the order defined during app compile time.[3]
    • All class definitions used by the application (views, logic, etc) must be loaded prior to Frame 2. It is here, in Frame1, that your preloader code can even install patches to the Flex framework BEFORE the framework classes themselves are loaded.
    • This technique is called "monkey-patching " and will be used later
      when we are discussing the decryption process.
    1. Once the Application instance has been created, the SystemManager sets Application.systemManager to itself. This is how you, the application developer, can access the SystemManager at a later time.
    2. The Application dispatches the preinitialize event at the beginning of the initialization process.
    3. Application goes on to create its children. The method createChildren() is called on the application. At this point each of the application’s components is being constructed, and each component’s createChildren() will be also called. For detail, look at component lifecycle section.
    4. The Application dispatches the initialize event, which indicates that all application’s components have been initialized. However, at this state, all the components are not yet laid out.
    5. Eventually, once all the Application child controls and containers have been created, sized and positioned, the Application dispatches the creationComplete event.
    6. Once the creationComplete event has been dispatched, the Preloader removes the DownloadProgressBar control and the SystemManager adds the Application instance to the Flash Player display list. (The Flash Player display list is basically the tree of visible or potentially visible objects that make up your application. When you add and remove child components to your application, your basically just adding and removing them from the display list).
    7. Once the Application is added to the Flash Player display list, the Application dispatches its applicationComplete event
    8. The Application has been created and is up on the screen ready to be interacted with.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值