Question

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

<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 consulter la propriété backgroundImage en utilisant l'id « Logobox »

Était-ce utile?

La solution

BackgroundImage est un style de HBox. Une fois le composant a été créé besoin pour définir le style comme ceci:

logoBox.setStyle("backgroundImage","images/img_header_new_2-bg.jpg");
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top