`
cuixuxucui
  • 浏览: 350796 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Event.FRAME_CONSTRUCTED

 
阅读更多

_oPBox是个MovieClip,共3帧,其中第1帧有个TextField,名字叫txt_leftTime。

 

_oPBox.gotoAndStop(1);

_oPBox.getChildByName("txt_leftTime") as TextField

 

在某些情况下,我发现getChildByName会失效,即取到的对象变成了null.

 

后来查到了原因,在MovieClip使用gotoAndStop切换帧的时候,都会重新初始化里面的变量和内容。当未初始化完毕时,去取getChildByName,就有可能取不到。

 

解决办法是:

_oPBox.addEventListener(Event.FRAME_CONSTRUCTED, constructedHandler);

_oPBox.gotoAndStop(1);

 

然后在constructedHandler中去取_oPBox.getChildByName("txt_leftTime") as TextField

分享到:
评论

相关推荐

    learn_constructed_function.zip_learn c

    在编程领域,C++是一种广泛使用的面向对象的编程语言,而构造函数...在“learn_constructed_function.zip_learn c”项目中,我们有机会深入学习这些概念,并通过"learn_constructed_function.cpp"的实际示例加深理解。

    spmi.rar_spmi

    描述中的"add a device previously constructed via spmi_device_alloc."是指在系统中添加一个之前通过spmi_device_alloc函数创建的设备。这通常涉及到设备驱动程序的开发过程,特别是针对需要使用SPMI接口的硬件...

    C++ 对象计数.rar_counting object_计数

    MyClass() { std::cout << "MyClass constructed" ; } ~MyClass() { std::cout ; } }; int main() { std::shared_ptr<MyClass> shared_obj = std::make_shared(); std::weak_ptr<MyClass> weak_obj = shared_...

    CBST.rar_The Keys_bst

    Now given a sequence of distinct non-negative integer keys, a unique BST can be constructed if it is required that the tree must also be a CBT. You are supposed to output the level order traversal ...

    php-gd-image-watermark.zip_The Image

    Watermark Creation We create the mark using a pseudorandom generator and a bi-valued +/-1 random sequence. The sequence is constructed as follows:

    C_Sharp_Programming.zip_Quick

    A very well constructed C# programming book that will allow even non programmers to get a quick grasp on C# basics.

    ldpc.rar_NOISE

    In information theory, a low-density parity-check (LDPC) code is a linear error correcting code, a method of transmitting a message over a noisy transmission channel.[1][2] An LDPC is constructed ...

    elec_brushless_dc_motor.zip_As One_SIMULINK_brushless_brushless

    a servomotor) can be constructed and parameterized based on datasheet information. The motor and driver are modeled as a single masked subsystem. If viewing the model in Simulink(R), the Motor and ...

    常见的findbugs解决方案

    1. DMIDMI_BIGDECIMAL_CONSTRUCTED_FROM_DOUBLE:由 double 构造 BigDecimal 时,没有指定精确度,会造成精度不正确。 例如,错误的写法:BigDecimal bd = new BigDecimal(0.1); 正确的写法:BigDecimal bd = new ...

    django_project.zip_WEB开发_Python_

    It s a web page constructed in a django framework including shop

    pruebas.rar_matlab例程_matlab_

    this code is for a filter constructed using transconductors in the gm-C code can get answers frecuancia pole and phase

    Python采用Kruskal(克鲁斯卡尔)算法实现最小生成树

    print("Edges in the constructed MST") for u, v, weight in result: print(f"{u} -- {v} == {weight}") ``` #### 代码解释 1. **并查集类 `UnionFind`**:定义了并查集的数据结构,包括初始化、查找和合并操作...

    NVDT:一种从基因序列预测蛋白质与蛋白质相互作用和非相互作用的新计算方法

    NVDT 一种新的计算方法,用于从基因序列预测蛋白质与蛋白质的相互作用和非相互作用。第1部分:数据集---每个物种的正负样本。 每个.xlsx文件都有两列... (2) Constructed-Datasets :从DIP数据库中收集阳性样品,并通

    C#多功能成语字典。这是一个用C#完成的多功能成语字典。

    /// The index table constructed by the first word in each idiom. /// public char[] firstWordConstructedIndexTable; /// /// Represents the index table's count. /// public int ...

    必修五单词填空练习(含答案).docx

    22. "The Golden Bridge _________(was constructed) in 1933-1937." 这句话是过去时态,表示桥是在过去的某个时间建造的,所以填 "was constructed"。 23. "The little boy was very _________at the _________...

    ag_news文本分类数据集

    The AG's news topic classification dataset is constructed by Xiang Zhang (xiang.zhang@nyu.edu) from the dataset above. It is used as a text classification benchmark in the following paper: Xiang Zhang...

    ag_news_csv.tgz

    The AG's news topic classification dataset is constructed by Xiang Zhang (xiang.zhang@nyu.edu) from the dataset above. It is used as a text classification benchmark in the following paper: Xiang Zhang...

    MahNMF Manhattan Non-negative Matrix Factorization

    % SIM_MTX : Similarity matrix constructed by 'constructW'. % GPP_MTX : Group pattern for boundary of all groups. % TOL_INNR : Stopping tolerance of inner iterations. Default is 1e-2. % TOL_OUTR : ...

    matlab2tikz/matlab2​tikz 源码

    For plots constructed with third- party packages, your mileage may vary. The workflow is as follows. a. Place the matlab2tikz scripts (contents of src/ folder) in a directory where MATLAB can find ...

    2020_2021学年新教材高中英语UNIT4HISTORYANDTRADITIONS同步作业含解析新人教版必修第二册202103121116

    * 知识点:选择正确的时态,了解construct、constructing、constructed和to construct的区别。 13. If ________, Mr. Smith, who is rich in experience, will turn out to be an excellent manager. * 知识点:...

Global site tag (gtag.js) - Google Analytics