gpt4 book ai didi

apache-flex - Flex 4 - 当容器的子级依赖于状态时如何循环它们

转载 作者:行者123 更新时间:2023-12-04 02:48:14 24 4
gpt4 key购买 nike

Flex 的新状态重新设置了标有 includeIn/excludeFrom 的视觉项目的父级。如果我有一个包含 5 个受状态控制的子元素/元素的组 (MainGroup),是否还有办法获取对 MainGroup 子元素的引用? mainGroup.numChildren 和 mainGroup.numElements 不起作用,因为子级被重新设置了父级。最好的情况下,它们显示 1。

<s:states>
<s:State name="view1State" />
<s:State name="view2State" />
<s:State name="view3State" />
<s:State name="view4State" />
</s:states>

<s:Group id="mainGroup">
<shipping:OrderShipping id="view1"
includeIn="view1State" />
<payment:OrderPayment id="view2"
includeIn="view2State" />
<verification:OrderVerification id="view3"
includeIn="view3State" />
<confirmation:OrderConfirmation id="view4"
includeIn="view4State" />
</s:Group>

最佳答案

如果你想让状态控制visible/includeinlayout而不是parenthood,就这样做

<s:states>
<s:State name="view1State" />
<s:State name="view2State" />
<s:State name="view3State" />
<s:State name="view4State" />
</s:states>
<s:Group id="mainGroup">
<shipping:OrderShipping id="view1"
visible="false"
includeInLayout="false"
visible.view1State="true"
includeInLayout.view1State="true"/>
<payment:OrderPayment id="view2"
visible="false"
includeInLayout="false"
visible.view2State="true"
includeInLayout.view2State="true"/>
<verification:OrderVerification id="view3"
visible="false"
includeInLayout="false"
visible.view3State="true"
includeInLayout.view3State="true" />
<confirmation:OrderConfirmation id="view4"
visible="false"
includeInLayout="false"
visible.view4State="true"
includeInLayout.view4State="true"/>
</s:Group>

关于apache-flex - Flex 4 - 当容器的子级依赖于状态时如何循环它们,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7099128/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com