Actionscript 3 Flex 4.5,针对相同的组件

Actionscript 3 Flex 4.5,针对相同的组件,actionscript-3,apache-flex,flex4.5,Actionscript 3,Apache Flex,Flex4.5,我不是flex专家,我是初学者,所以这可能是不可能的 我有点像: <s:VGroup gap="2" paddingLeft="1" paddingTop="1"> <s:BorderContainer rollOver="fadeInBorderComponent.play(); fadeInLabel.play()" rollOu

我不是flex专家,我是初学者,所以这可能是不可能的

我有点像:

<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数组,这可能吗

多谢各位

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

for(i=0; i<vgroup.numElements;i++)
{
  yourFade.targets.push(vgroup.getElementAt(i));
}

用于(i=0;我为什么不想使用Ids?@ethrbunny如果我假设有50个BorderContainer控件,或者我动态创建它们,那么使用Ids没有意义,那么最好以其他方式确定它的目标。您好,谢谢,我知道目标数组,但我不知道如何使用它,我将尝试您的解决方案,谢谢目标数组我s与普通目标属性一样,它可以用于在多个显示对象上播放效果。例如,fade.targets=[component1,component2,component3];