`

关于ADDED_TO_STAGE事件

阅读更多

 

在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。 以下方法会触发此事件:DE>DisplayObjectContainer.addChild()DE>、DE>DisplayObjectContainer.addChildAt()DE>。

 

       很多时候,可视类初始化的时候,要用到stage属性,则必须使用Event.ADDED_TO_STAGE事件,有的时候,连文档类初始化时,也需要用到Event.ADDED_TO_STAGE,原因是这个swf将被其它的文件加载,如果直接在初始化函数内使用stage属性,单独发布是没问题的,但联调时就会发生问题。

 

 

       但是,文档类初始化函数内的Event.ADDED_TO_STAGE,当这个swf被其他文件加载时,很有可能被触发两次,如果你将所有真正的初始化代码都写在Event.ADDED_TO_STAGE事件相应函数内,所有的可视化元素,将会被new出来两份,所有的侦听,将会有两份...

 

 

       这个现象很隐蔽,往往发生了也不报错,从表面上也看不出问题,但一旦发生,轻则降低机器性能,重则会发生很多灵异事件,例如明明把某个元素visible设成false了,但屏幕上还是能看到它,原因就是new出来东西,都将有两份。Event.ADDED_TO_STAGE被广播两次的原因,可能是文档类的特殊性造成的,它自己初始化的时候被触发一次,被加载并显示的时候再触发一次。

分享到:
评论

相关推荐

    MEMS An_Introduction_to_Microelectromechanical_Systems_Engineering

    added several references to each chapter to direct the advanced reader to the source of the material. We also expanded the glossary to assist the novice in understanding and relating to a new ...

    FastReport_.NET_Resigned_NetFx4_Bins_2019.3.20.rar

    - fixed image size calculation when AutoSize is enabled in the preparation stage - fixed RichText lists format - fixed a bug when font changed in parent report were not changed in inherited report * ...

    pipelined_adc_model_testscript.m

    The model resolution is very flexible, and system level techniques are easily added. A matlab script for processing the data is also included. pipelined_adc_model.mdl pipelined_adc_model_testscript.m...

    10bitADC_lifule.m

    The model resolution is very flexible, and system level techniques are easily added. A matlab script for processing the data is also included. pipelined_adc_model.mdl pipelined_adc_model_testscript.m...

    LCTF软件备份VariSpec™ Liquid Crystal Tunable Filters

    g) The VsGui program was modified to add sweep function, and the associated files were added to the file manifest. The new functions are assigned higher ordinal numbers than the earlier commands, so ...

    BURNINTEST--硬件检测工具

    - Added additional USB 2.0 Loopback plug test initialization to ensure plugs are in a 'clean' state when starting the USB tests. This was added due to reported USB data verification errors after ...

    fsys.rar_The Process

    Finalizes DPLL registration process. In case a failure (clk-ref or clk-bypass is missing), the clock is added to retry list and the initialization is retried on later stage.

    OpenGL 4.0 Shading Language Cookbook

    With version 4.0, the language has been further refined to provide programmers with greater flexibility, and additional features have been added such as an entirely new stage called the tessellation ...

    kgb档案压缩console版+源码

    To compress: PAQ6 -3 archive file file... (1 or more file names), or or (MSDOS): dir/b | PAQ6 -3 archive (read file names from input) or (UNIX): ls | PAQ6 -3 archive To decompress: PAQ6 archive (no ...

    UMAP Journal 38.2 2017 ICM Contest

    It's a chance to challenge your brain, solve a real world math problem, and get recognition for it on an international stage. It's an excellent opportunity to develop your interpersonal skills ...

    多系统启动-变色龙-最新版本

    It is based on David Elliott's fake EFI implementation added to Apple's boot-132 project. Chameleon is extended with the following key features: - Device Property Injection via device-properties ...

    A&H IDR-8音频处理器说明

    located at the side of a theatre stage. Furthermore, the 8-buss link can be used to distribute signals around a complex network where iDR units communicate via TCP/IP - here, interbox paging and ...

    DisUnity v0.2.1 Unity3D资源提取

    Support for static meshes is also planned, but will be added later, due to the complexity of the mesh data. There's no GUI for the tool yet, since it's still in an early experimental stage. So if ...

    oracle asm rac

    Login to [iface: default, target: iqn.2012-09.com.example:server.target4, portal: 192.168.10.10,3260]: successful 查看磁盘信息 [root@node1 /]# fdisk -l Node2端: [root@node2 ~]# yum install *scsi* ...

    grub4dos-V0.4.6a-2017-02-04更新

    使 common.c、stage2.c 中的代码与 0.4.5c 保持一致(除 0.4.6a 有意改动的)。 2014-07-9(yaya) 修正软盘搜索。 支持 16 插槽映射。 2014-06-23(yaya) 1.完善了有碎片的文件仿真。最多 32 段碎片。若全部采用...

    a project model for the FreeBSD Project.7z

    Number of ports added between 1996 and 2005 Foreword Up until now, the FreeBSD project has released a number of described techniques to do different parts of work. However, a project model ...

    VB编程资源大全(英文源码 网络)

    Configuration is added to choose which MS Agent to use and the Time interval use to check for mails<END><br>30 , wsc_ftp_client.zip FTP Client Sample Application. It was built with MS Winsock ...

    数学建模教材目录大全

    It's a chance to challenge your brain, solve a real world math problem, and get recognition for it on an international stage. It's an excellent opportunity to develop your interpersonal skills through...

    Cesium -1.47

    Added heightReference and extrudedHeightReference properties to CorridorGraphics, EllipseGraphics, PolygonGraphics and RectangleGraphics. #6717 PostProcessStage has a selected property which is an ...

    avengers-stage-2-frontend-ironman

    (克隆后)单击: git checkout -b "ft-username" (to create your branch) 步骤4.(添加代码后)使用git add .添加您的贡献git add . 步骤5.使用git commit -m "feat: username added"来提交您的更改 步骤6.使用...

Global site tag (gtag.js) - Google Analytics