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 に答える