0

我不是弹性专家,我是初学者,所以也许这是不可能的。

我有类似的东西:

<s:VGroup gap="2" paddingLeft="1" paddingTop="1">   
                    <s:BorderContainer 
                        rollOver="fadeInBorderComponent.play(); fadeInLabel.play()" 
                        rollOut="fadeOutBorderComponent.play(); fadeOutLabel.play()" 

                        buttonMode="true" useHandCursor="true" 
                        borderColor="0x808080" alpha="0.8" borderWeight="2">                                            
                        <s:Label  width="140" height="60" 
                                 backgroundColor="0xffffff" alpha="0.0" paddingBottom="2" paddingLeft="2" paddingRight="2" paddingTop="4" depth="1" styleName="captionText"
                                 text="Very, very long text to be wrap, long text to be wrap, long text to be wrap, long text to be wrap, long text to be wrap, long text to be wrap, this the end of a text" />
                        <s:Image width="140" height="125" scaleMode="stretch" source="assets/Koala.jpg">                    
                        </s:Image>                      
                    </s:BorderContainer>
                    <s:BorderContainer 
                        rollOver="fadeInBorderComponent.play(); fadeInLabel.play()" 
                        rollOut="fadeOutBorderComponent.play(); fadeOutLabel.play()" 

                        buttonMode="true" useHandCursor="true" 
                        borderColor="0x808080" alpha="0.8" borderWeight="2">                                            
                        <s:Label  width="140" height="60" 
                                 backgroundColor="0xffffff" alpha="0.0" paddingBottom="2" paddingLeft="2" paddingRight="2" paddingTop="4" depth="1" styleName="captionText"
                                 text="Very, very long text to be wrap, long text to be wrap, long text to be wrap, long text to be wrap, long text to be wrap, long text to be wrap, this the end of a text" />
                        <s:Image width="140" height="125" scaleMode="stretch" source="assets/Koala.jpg">                    
                        </s:Image>                      
                    </s:BorderContainer>                    
                </s:VGroup>

这是我的代码:

    <s:Fade target="{BorderContainer}" id="fadeInBorderComponent" duration="300" alphaTo="1.0" />                   
    <s:Fade target="{BorderContainer}" id="fadeOutBorderComponent" duration="200" alphaTo="0.8" />      

    <s:Fade target="{Label}" id="fadeInLabel" duration="300" alphaTo="0.8" />                   
    <s:Fade target="{Label}" id="fadeOutLabel" duration="200" alphaTo="0.0" />

我的问题是,如何定位所有属于 vGroup 子级的 BorderContainer 而不是使用 ID 或 ID 数组,这可能吗?

谢谢你。

4

1 回答 1

1

效果类有一个“目标”数组。您可以将所有边框容器放在该数组中。

for(i=0; i<vgroup.numElements;i++)
{
  yourFade.targets.push(vgroup.getElementAt(i));
}
于 2012-07-18T13:47:19.653 回答