2010-10-25 3 views
0

J'ai attribué une image de logo de mon logiciel HBox comme suit: -Changer l'image de fond de HBox

<mx:HBox id="logoBox" width="98%" textAlign="left" backgroundSize="100%" horizontalAlign="left" height="18%" backgroundImage="images/img_header_new_3-bg.jpg" verticalAlign="bottom" backgroundColor="#1573A4"> 

Maintenant, je dois changer l'backgroundImage à une autre image sur un événement. Comment y parvenir? Je ne suis pas en mesure de référencer la propriété backgroundImage à l'aide de l'ID 'logoBox'

Répondre

1

BackgroundImage est un style de HBox. Une fois le composant créé, vous devez définir le style comme suit:

logoBox.setStyle("backgroundImage","images/img_header_new_2-bg.jpg"); 
Questions connexes